diff options
Diffstat (limited to 'include/spdlog/common.h')
-rw-r--r-- | include/spdlog/common.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 9ab886f5..ae51c745 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -126,6 +126,13 @@ using sink_ptr = std::shared_ptr<sinks::sink>; using sinks_init_list = std::initializer_list<sink_ptr>; using err_handler = std::function<void(const std::string &err_msg)>; #ifdef SPDLOG_USE_STD_FORMAT +# ifndef FMTLIB_BEGIN_NAMESPACE +# define FMTLIB_BEGIN_NAMESPACE \ + namespace std { +# define FMTLIB_END_NAMESPACE \ + } +# endif + namespace fmt_lib = std; using string_view_t = std::string_view; @@ -146,7 +153,16 @@ template<typename... Args> using wformat_string_t = std::wstring_view; # endif # define SPDLOG_BUF_TO_STRING(x) x + #else // use fmt lib instead of std::format + +# ifndef FMTLIB_BEGIN_NAMESPACE +# define FMTLIB_BEGIN_NAMESPACE \ + namespace fmt { +# define FMTLIB_END_NAMESPACE \ + } +# endif + namespace fmt_lib = fmt; using string_view_t = fmt::basic_string_view<char>; |