Skip to content

Commit

Permalink
Fix harmless MSVS warning about using undefined _MANAGED symbol
Browse files Browse the repository at this point in the history
Since the changes of 1305cbe (Fix MSVC2019 error C2049 when compiling
with /clr (fmtlib#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.
  • Loading branch information
vadz committed Mar 15, 2021
1 parent e737672 commit 6efdda8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6efdda8

Please sign in to comment.