From 6efdda8ef3ad8c598a542d1a4c52c5b044cd1803 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 15 Mar 2021 14:07:26 +0100 Subject: [PATCH] Fix harmless MSVS warning about using undefined _MANAGED symbol Since the changes of 1305cbeb (Fix MSVC2019 error C2049 when compiling with /clr (#1897), 2020-09-23), compiling fmt with MSVS 2019 resulted in fmt\include\fmt\core.h(180,32): warning C4668: '_MANAGED' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'. when the (disabled by default) warning C4668 was enabled. Fix this simply by checking if _MANAGED is defined before testing it. --- include/fmt/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index d7d2de50126f..37f5c2e99524 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -177,7 +177,7 @@ #ifndef FMT_USE_INLINE_NAMESPACES # if FMT_HAS_FEATURE(cxx_inline_namespaces) || FMT_GCC_VERSION >= 404 || \ - (FMT_MSC_VER >= 1900 && !_MANAGED) + (FMT_MSC_VER >= 1900 && (!defined(_MANAGED) || !_MANAGED)) # define FMT_USE_INLINE_NAMESPACES 1 # else # define FMT_USE_INLINE_NAMESPACES 0