From 39d2a8da2b2f2b1342861bf7f9a8d0f9634f654d Mon Sep 17 00:00:00 2001 From: darklukee Date: Wed, 21 Oct 2020 09:45:41 +0200 Subject: [PATCH] Add option to force usage of inline namespaces Detection of inline namespaces is imperfect as some compilers don't provide __has_feature This option allows to override it if needed. --- include/fmt/core.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 2d657a8d..948b3d21 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -178,9 +178,17 @@ # endif #endif -#ifndef FMT_BEGIN_NAMESPACE +#ifndef FMT_USE_INLINE_NAMESPACES # if FMT_HAS_FEATURE(cxx_inline_namespaces) || FMT_GCC_VERSION >= 404 || \ (FMT_MSC_VER >= 1900 && !_MANAGED) +# define FMT_USE_INLINE_NAMESPACES 1 +# else +# define FMT_USE_INLINE_NAMESPACES 0 +# endif +#endif + +#ifndef FMT_BEGIN_NAMESPACE +# if FMT_USE_INLINE_NAMESPACES # define FMT_INLINE_NAMESPACE inline namespace # define FMT_END_NAMESPACE \ } \