diff --git a/include/fmt/core.h b/include/fmt/core.h index 790ba42a..fa9ca09c 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -49,13 +49,6 @@ # define FMT_ICC_VERSION 0 #endif -#ifdef __NVCOMPILER -# define FMT_NVCOMPILER_VERSION \ - (__NVCOMPILER_MAJOR__ * 100 + __NVCOMPILER_MINOR__) -#else -# define FMT_NVCOMPILER_VERSION 0 -#endif - #ifdef __NVCC__ # define FMT_NVCC __NVCC__ #else @@ -70,6 +63,12 @@ # define FMT_MSC_WARNING(...) #endif +#ifdef _MSVC_LANG +# define FMT_CPLUSPLUS _MSVC_LANG +#else +# define FMT_CPLUSPLUS __cplusplus +#endif + #ifdef __has_feature # define FMT_HAS_FEATURE(x) __has_feature(x) #else @@ -90,12 +89,6 @@ # define FMT_HAS_CPP_ATTRIBUTE(x) 0 #endif -#ifdef _MSVC_LANG -# define FMT_CPLUSPLUS _MSVC_LANG -#else -# define FMT_CPLUSPLUS __cplusplus -#endif - #define FMT_HAS_CPP14_ATTRIBUTE(attribute) \ (FMT_CPLUSPLUS >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute)) @@ -287,7 +280,7 @@ // Enable minimal optimizations for more compact code in debug mode. FMT_GCC_PRAGMA("GCC push_options") -#if !defined(__OPTIMIZE__) && !FMT_NVCOMPILER_VERSION +#if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER) FMT_GCC_PRAGMA("GCC optimize(\"Og\")") #endif diff --git a/include/fmt/format.h b/include/fmt/format.h index 95504a85..c9774e64 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -166,11 +166,11 @@ FMT_END_NAMESPACE // https://github.com/fmtlib/fmt/issues/2510. #ifndef __ICL # if FMT_HAS_BUILTIN(__builtin_ctz) || FMT_GCC_VERSION || FMT_ICC_VERSION || \ - FMT_NVCOMPILER_VERSION + defined(__NVCOMPILER) # define FMT_BUILTIN_CTZ(n) __builtin_ctz(n) # endif # if FMT_HAS_BUILTIN(__builtin_ctzll) || FMT_GCC_VERSION || \ - FMT_ICC_VERSION || FMT_NVCOMPILER_VERSION + FMT_ICC_VERSION || defined(__NVCOMPILER) # define FMT_BUILTIN_CTZLL(n) __builtin_ctzll(n) # endif #endif