From 23d33b763006f2b3ad200f59a104b7269811dfee Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 17 Jun 2019 16:39:57 +0100 Subject: [PATCH] Check if compiler symbols are defined before using them If we don't do this, projects using `-Werror=undef` will break. --- glib/gmacros.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glib/gmacros.h b/glib/gmacros.h index a262aaf74..1c8d64699 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -988,8 +988,8 @@ #endif #if !defined(GLIB_DISABLE_DEPRECATION_WARNINGS) && \ - (__GNUC__ > 6 || (__GNUC__ == 6 && __GNUC_MINOR__ >= 1) || \ - __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 0)) + ((defined (__GNUC__) && (__GNUC__ > 6 || (__GNUC__ == 6 && __GNUC_MINOR__ >= 1))) || \ + (defined (__clang_major__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 0)))) #define GLIB_DEPRECATED_ENUMERATOR G_DEPRECATED #define GLIB_DEPRECATED_ENUMERATOR_FOR(f) G_DEPRECATED_FOR(f) #define GLIB_UNAVAILABLE_ENUMERATOR(maj,min) G_UNAVAILABLE(maj,min) @@ -1000,8 +1000,8 @@ #endif #if !defined(GLIB_DISABLE_DEPRECATION_WARNINGS) && \ - (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || \ - __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 0)) + ((defined (__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) || \ + (defined (__clang_major__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 0)))) #define GLIB_DEPRECATED_TYPE G_DEPRECATED #define GLIB_DEPRECATED_TYPE_FOR(f) G_DEPRECATED_FOR(f) #define GLIB_UNAVAILABLE_TYPE(maj,min) G_UNAVAILABLE(maj,min)