gmacros.h: raise minimum GCC version for attribute __noreturn__

`#define G_GNUC_NORETURN __attribute__((__noreturn__))` was previously under
`#if G_GNUC_CHECK_VERSION(2, 4)`.

But `# define G_NORETURN __attribute__ ((__noreturn__))` was under
`#if G_GNUC_CHECK_VERSION(2, 8) || (0x5110 <= __SUNPRO_C)`.

Take the latter for `g_macro__has_attribute(__noreturn__)` fallback. This will
disable `G_GNUC_NORETURN` for GCC 2.4-2.7 though.
This commit is contained in:
Aleksandr Mezin 2021-04-16 14:51:41 +06:00
parent 2b9bf7b162
commit 56be1f8d82

View File

@ -134,7 +134,7 @@
#define g_macro__has_attribute___alloc_size__ G_GNUC_CHECK_VERSION (4, 3) #define g_macro__has_attribute___alloc_size__ G_GNUC_CHECK_VERSION (4, 3)
#define g_macro__has_attribute___format__ G_GNUC_CHECK_VERSION (2, 4) #define g_macro__has_attribute___format__ G_GNUC_CHECK_VERSION (2, 4)
#define g_macro__has_attribute___format_arg__ G_GNUC_CHECK_VERSION (2, 4) #define g_macro__has_attribute___format_arg__ G_GNUC_CHECK_VERSION (2, 4)
#define g_macro__has_attribute___noreturn__ G_GNUC_CHECK_VERSION (2, 4) #define g_macro__has_attribute___noreturn__ (G_GNUC_CHECK_VERSION (2, 8) || (0x5110 <= __SUNPRO_C))
#define g_macro__has_attribute___const__ G_GNUC_CHECK_VERSION (2, 4) #define g_macro__has_attribute___const__ G_GNUC_CHECK_VERSION (2, 4)
#define g_macro__has_attribute___unused__ G_GNUC_CHECK_VERSION (2, 4) #define g_macro__has_attribute___unused__ G_GNUC_CHECK_VERSION (2, 4)
#define g_macro__has_attribute___no_instrument_function__ G_GNUC_CHECK_VERSION (2, 4) #define g_macro__has_attribute___no_instrument_function__ G_GNUC_CHECK_VERSION (2, 4)
@ -1040,7 +1040,7 @@
* evaluated when a header is included. This results in warnings in third party * evaluated when a header is included. This results in warnings in third party
* code which includes glib.h, even if the third party code doesnt use the new * code which includes glib.h, even if the third party code doesnt use the new
* macro itself. */ * macro itself. */
#if G_GNUC_CHECK_VERSION(2, 8) || (0x5110 <= __SUNPRO_C) #if g_macro__has_attribute(__noreturn__)
/* For compatibility with G_NORETURN_FUNCPTR on clang, use /* For compatibility with G_NORETURN_FUNCPTR on clang, use
__attribute__((__noreturn__)), not _Noreturn. */ __attribute__((__noreturn__)), not _Noreturn. */
# define G_NORETURN __attribute__ ((__noreturn__)) # define G_NORETURN __attribute__ ((__noreturn__))
@ -1079,7 +1079,7 @@
* *
* Since: 2.68 * Since: 2.68
*/ */
#if G_GNUC_CHECK_VERSION(2, 8) || (0x5110 <= __SUNPRO_C) #if g_macro__has_attribute(__noreturn__)
# define G_NORETURN_FUNCPTR __attribute__ ((__noreturn__)) \ # define G_NORETURN_FUNCPTR __attribute__ ((__noreturn__)) \
GLIB_AVAILABLE_MACRO_IN_2_68 GLIB_AVAILABLE_MACRO_IN_2_68
#else #else