gmacros: check that __cplusplus or _MSC_VER is defined

Otherwise it will fail to compile in old distros like Centos 7
Fixes #2387
This commit is contained in:
Ignacio Casal Quinteiro 2021-04-21 10:43:52 +02:00
parent 80a938a205
commit 2c97526c00

View File

@ -1044,11 +1044,11 @@
/* For compatibility with G_NORETURN_FUNCPTR on clang, use
__attribute__((__noreturn__)), not _Noreturn. */
# define G_NORETURN __attribute__ ((__noreturn__))
#elif 1200 <= _MSC_VER
#elif defined (_MSC_VER) && (1200 <= _MSC_VER)
/* Use MSVC specific syntax. */
# define G_NORETURN __declspec (noreturn)
/* Use ISO C++11 syntax when the compiler supports it. */
#elif (__cplusplus >= 201103 && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) || (_MSC_VER >= 1900)
#elif (defined (__cplusplus) && __cplusplus >= 201103 && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) || defined (_MSC_VER) && (_MSC_VER >= 1900)
# define G_NORETURN [[noreturn]]
/* Use ISO C11 syntax when the compiler supports it. */
#elif __STDC_VERSION__ >= 201112 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)