summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2021-04-29 12:48:50 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2021-04-29 12:48:50 +0000
commitf4f9ce7bde88fd6c000c219a3edb9626dc1beb9c (patch)
tree68db8d1eb2798d60322411cf057621c188ec6ac9
parent8312f0b7cf5cd7910684dbc6b63b7d8bbf8b0569 (diff)
parent98050b756b5eef35aa37b0f1a0d0daa54193784f (diff)
downloadglib-f4f9ce7bde88fd6c000c219a3edb9626dc1beb9c.tar.gz
Merge branch 'gnuc_macro_updates' into 'master'
gmacros: use G_GNUC_CHECK_VERSION Closes #2389 See merge request GNOME/glib!2073
-rw-r--r--glib/gbitlock.c3
-rw-r--r--glib/tests/test-printf.c8
-rw-r--r--gobject/gtype.h2
3 files changed, 7 insertions, 6 deletions
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 <glib/gmacros.h>
#include <glib/gmessages.h>
#include <glib/gatomic.h>
#include <glib/gslist.h>
@@ -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
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
}
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); \
\