From: Arnaud Giersch Date: Tue, 6 Oct 2020 13:32:23 +0000 (+0200) Subject: Check C++ standard in xbt/base.h. X-Git-Tag: v3.26~374 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5004e62b0038cf93f205c6eacb0d46c17258ce89 Check C++ standard in xbt/base.h. --- diff --git a/ChangeLog b/ChangeLog index 4bcc2e75a9..a2e17e2840 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,6 +40,7 @@ C binding: General: - Require a compiler with C++14 support. + Take care to upgrade FindSimgrid.cmake if it's used. - LTO is now enabled for Intel/clang compilers. - LTO behavior on GCC can be parameterized using LTO_EXTRA_FLAG in cmake. Setting it to "auto" will use all available cores, while setting it to n will diff --git a/include/xbt/base.h b/include/xbt/base.h index 8d6b05d609..860fdf007a 100644 --- a/include/xbt/base.h +++ b/include/xbt/base.h @@ -28,15 +28,14 @@ #endif #if defined(__cplusplus) -#if __cplusplus >= 201103L -#define XBT_ATTRIB_NORETURN [[noreturn]] +#if __cplusplus < 201402L +#error C++14 support is needed. Please upgrade your compiler and/or fix your compilation flags. #endif +#define XBT_ATTRIB_NORETURN [[noreturn]] #if __cplusplus >= 201703L #define XBT_ATTRIB_UNUSED [[maybe_unused]] #endif -#if __cplusplus >= 201402L #define XBT_ATTRIB_DEPRECATED(mesg) [[deprecated(mesg)]] -#endif #elif defined(__STDC_VERSION__) #if __STDC_VERSION__ >= 201112L #define XBT_ATTRIB_NORETURN _Noreturn