Use a different solution to suppress C4574 while still compiling on Mac

This commit is contained in:
Alexander Bock 2017-07-07 10:02:09 -04:00 committed by GitHub
parent 7eff0809a4
commit fa24093789

View File

@ -121,13 +121,27 @@ typedef __int64 intmax_t;
# define FMT_GNUC_LIBSTD_VERSION (__GNUC_LIBSTD__ * 100 + __GNUC_LIBSTD_MINOR__) # define FMT_GNUC_LIBSTD_VERSION (__GNUC_LIBSTD__ * 100 + __GNUC_LIBSTD_MINOR__)
#endif #endif
// GLM defines __has_feature to '0' which causes MSVC to throw C4574 // GLM defines __has_feature to '0' which causes MSVC to throw C4574
#if (defined(__has_feature) && (__has_feature)) // An #if check against __has_feature makes Clang unhappy, so the only way
// around this is to disable the warning for Microsoft Visual Studio
// Even though this is all macros, this will still work since it is the
// #ifdef __has_feature that throws the error, not the macro expansion
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable : 4574)
#endif // _MSC_VER
#ifdef __has_feature
# define FMT_HAS_FEATURE(x) __has_feature(x) # define FMT_HAS_FEATURE(x) __has_feature(x)
#else #else
# define FMT_HAS_FEATURE(x) 0 # define FMT_HAS_FEATURE(x) 0
#endif #endif
// And reenabling it afterwards
#ifdef _MSC_VER
#pragma warning (pop)
#endif // _MSC_VER
#ifdef __has_builtin #ifdef __has_builtin
# define FMT_HAS_BUILTIN(x) __has_builtin(x) # define FMT_HAS_BUILTIN(x) __has_builtin(x)
#else #else