From 280b5612c09ccb772e1b16fb2fcec2ab56b31888 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 531a93aa..37d27285 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 \ } \