diff options
author | Kevin Slattery <kslattery@shottracker.com> | 2022-05-11 23:14:41 +0300 |
---|---|---|
committer | Kevin Slattery <kslattery@shottracker.com> | 2022-05-11 23:14:41 +0300 |
commit | 5f5e70e96eaf8a0c3c74aaf4c5bbe39fe7f3dea1 (patch) | |
tree | 268bb4d3f98679960098e5e1d415f98b93db5786 /include/spdlog | |
parent | 128cbe5a06051e0bc43d90c2434f7f68a2900587 (diff) |
C++14 build fixes for older gcc #2333
Diffstat (limited to 'include/spdlog')
-rw-r--r-- | include/spdlog/common.h | 16 | ||||
-rw-r--r-- | include/spdlog/fmt/bin_to_hex.h | 6 |
2 files changed, 20 insertions, 2 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>; diff --git a/include/spdlog/fmt/bin_to_hex.h b/include/spdlog/fmt/bin_to_hex.h index 93e5c28b..2a5d02c9 100644 --- a/include/spdlog/fmt/bin_to_hex.h +++ b/include/spdlog/fmt/bin_to_hex.h @@ -8,8 +8,10 @@ #include <cctype> #include <spdlog/common.h> -#if defined(__has_include) && __has_include(<version>) -# include <version> +#if defined(__has_include) +# if __has_include(<version>) +# include <version> +# endif #endif #if __cpp_lib_span >= 202002L |