Tweaks for EDG based compilers (Intel, nVidia, MCST/Elbrus, etc).

Using the __EDG_VERSION__ macro for checks related to EDG-based
compilers instead of a macros specific for each of ones.
This commit is contained in:
Leonid Yuriev 2020-06-22 19:54:02 +03:00 committed by Victor Zverovich
parent b287c37c65
commit 8bef1c3b3a

View File

@ -73,6 +73,7 @@
# if defined(__clang__) # if defined(__clang__)
# define FMT_FALLTHROUGH [[clang::fallthrough]] # define FMT_FALLTHROUGH [[clang::fallthrough]]
# elif FMT_GCC_VERSION >= 700 && !defined(__PGI) # elif FMT_GCC_VERSION >= 700 && !defined(__PGI)
&& (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 520)
# define FMT_FALLTHROUGH [[gnu::fallthrough]] # define FMT_FALLTHROUGH [[gnu::fallthrough]]
# else # else
# define FMT_FALLTHROUGH # define FMT_FALLTHROUGH
@ -127,11 +128,10 @@ FMT_END_NAMESPACE
#endif #endif
#ifndef FMT_USE_USER_DEFINED_LITERALS #ifndef FMT_USE_USER_DEFINED_LITERALS
// For Intel and NVIDIA compilers both they and the system gcc/msc support UDLs. // EDG based compilers (Intel, NVIDIA, Elbrus, etc), GCC and MSVC support UDLs.
# if (FMT_HAS_FEATURE(cxx_user_literals) || FMT_GCC_VERSION >= 407 || \ # if (FMT_HAS_FEATURE(cxx_user_literals) || FMT_GCC_VERSION >= 407 || \
FMT_MSC_VER >= 1900) && \ FMT_MSC_VER >= 1900) && \
(!(FMT_ICC_VERSION || FMT_CUDA_VERSION) || FMT_ICC_VERSION >= 1500 || \ (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= /* UDL feature */ 480)
FMT_CUDA_VERSION >= 700)
# define FMT_USE_USER_DEFINED_LITERALS 1 # define FMT_USE_USER_DEFINED_LITERALS 1
# else # else
# define FMT_USE_USER_DEFINED_LITERALS 0 # define FMT_USE_USER_DEFINED_LITERALS 0
@ -139,10 +139,10 @@ FMT_END_NAMESPACE
#endif #endif
#ifndef FMT_USE_UDL_TEMPLATE #ifndef FMT_USE_UDL_TEMPLATE
// EDG front end based compilers (icc, nvcc) and GCC < 6.4 do not propertly // EDG frontend based compilers (icc, nvcc, etc) and GCC < 6.4 do not propertly
// support UDL templates and GCC >= 9 warns about them. // support UDL templates and GCC >= 9 warns about them.
# if FMT_USE_USER_DEFINED_LITERALS && FMT_ICC_VERSION == 0 && \ # if FMT_USE_USER_DEFINED_LITERALS && \
FMT_CUDA_VERSION == 0 && \ (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 501) && \
((FMT_GCC_VERSION >= 604 && __cplusplus >= 201402L) || \ ((FMT_GCC_VERSION >= 604 && __cplusplus >= 201402L) || \
FMT_CLANG_VERSION >= 304) FMT_CLANG_VERSION >= 304)
# define FMT_USE_UDL_TEMPLATE 1 # define FMT_USE_UDL_TEMPLATE 1