diff options
author | Ignacio Casal Quinteiro <qignacio@amazon.com> | 2021-04-21 10:43:52 +0200 |
---|---|---|
committer | Ignacio Casal Quinteiro <qignacio@amazon.com> | 2021-04-21 10:43:52 +0200 |
commit | 90dca16d95b199b33b3a005f69c599b32fa3ecfc (patch) | |
tree | e3990fe1d9ab0d8f9b5344edda03c2b9498af47c | |
parent | e9587a480ab9acd299fe195f215362197cb29ec3 (diff) | |
download | glib-nacho/gmacros.tar.gz |
gmacros: check that __cplusplus or _MSC_VER is definednacho/gmacros
Otherwise it will fail to compile in old distros like Centos 7
-rw-r--r-- | glib/gmacros.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/glib/gmacros.h b/glib/gmacros.h index 2ece48ba0..4c571083b 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -960,11 +960,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) |