From 6cc9899f3d0a7495636669ec16a06b6da7bb7cbd Mon Sep 17 00:00:00 2001 From: Nishal Kulkarni Date: Thu, 29 Apr 2021 17:38:59 +0530 Subject: [PATCH 1/3] gbitlock: use G_GNUC_CHECK_VERSION Replace `__GLIBC__` with `G_GNUC_CHECK_VERSION` --- glib/gbitlock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glib/gbitlock.c b/glib/gbitlock.c index 45fb50999..3aa4b4a43 100644 --- a/glib/gbitlock.c +++ b/glib/gbitlock.c @@ -22,6 +22,7 @@ #include "gbitlock.h" +#include #include #include #include @@ -179,7 +180,7 @@ g_futex_wake (const volatile gint *address) static volatile gint g_bit_lock_contended[CONTENTION_CLASSES]; #if (defined (i386) || defined (__amd64__)) - #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) + #if G_GNUC_CHECK_VERSION(4, 5) #define USE_ASM_GOTO 1 #endif #endif From ad1fd7f998bf7b25db955f7035fceb3800737be7 Mon Sep 17 00:00:00 2001 From: Nishal Kulkarni Date: Thu, 29 Apr 2021 17:39:54 +0530 Subject: [PATCH 2/3] test-printf: use G_GNUC_CHECK_VERSION Replace `__GLIBC__` with `G_GNUC_CHECK_VERSION` --- glib/tests/test-printf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glib/tests/test-printf.c b/glib/tests/test-printf.c index dd1107432..59a461ddb 100644 --- a/glib/tests/test-printf.c +++ b/glib/tests/test-printf.c @@ -728,7 +728,7 @@ test_64bit (void) /* However, gcc doesn't know about this, so we need to disable printf * format warnings... */ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#if G_GNUC_CHECK_VERSION(4, 6) _Pragma ("GCC diagnostic push") _Pragma ("GCC diagnostic ignored \"-Wformat\"") _Pragma ("GCC diagnostic ignored \"-Wformat-extra-args\"") @@ -766,7 +766,7 @@ _Pragma ("GCC diagnostic ignored \"-Wformat-extra-args\"") g_assert_cmpint (res, ==, 5); g_assert_cmpstr (buf, ==, "1E240"); -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#if G_GNUC_CHECK_VERSION(4, 6) _Pragma ("GCC diagnostic pop") #endif @@ -819,7 +819,7 @@ test_64bit2_win32 (void) /* However, gcc doesn't know about this, so we need to disable printf * format warnings... */ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#if G_GNUC_CHECK_VERSION(4, 6) _Pragma ("GCC diagnostic push") _Pragma ("GCC diagnostic ignored \"-Wformat\"") _Pragma ("GCC diagnostic ignored \"-Wformat-extra-args\"") @@ -849,7 +849,7 @@ _Pragma ("GCC diagnostic ignored \"-Wformat-extra-args\"") res = g_printf ("%" "ll" "X\n", (gint64)123456); g_assert_cmpint (res, ==, 6); -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#if G_GNUC_CHECK_VERSION(4, 6) _Pragma ("GCC diagnostic pop") #endif } From 98050b756b5eef35aa37b0f1a0d0daa54193784f Mon Sep 17 00:00:00 2001 From: Nishal Kulkarni Date: Thu, 29 Apr 2021 17:40:14 +0530 Subject: [PATCH 3/3] gtype: use G_GNUC_CHECK_VERSION Replace `__GLIBC__` with `G_GNUC_CHECK_VERSION` --- gobject/gtype.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gobject/gtype.h b/gobject/gtype.h index 621c6514d..5f9766978 100644 --- a/gobject/gtype.h +++ b/gobject/gtype.h @@ -2108,7 +2108,7 @@ type_name##_get_type (void) \ /* Only use this in non-C++ on GCC >= 2.7, except for Darwin/ppc64. * See https://bugzilla.gnome.org/show_bug.cgi?id=647145 */ -#if !defined (__cplusplus) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !(defined (__APPLE__) && defined (__ppc64__)) +#if !defined (__cplusplus) && (G_GNUC_CHECK_VERSION(2, 7)) && !(defined (__APPLE__) && defined (__ppc64__)) #define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \ static GType type_name##_get_type_once (void); \ \