From 2d6bae70b4374a96e0d69c2396a3182d6973afff Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 9 Nov 2023 23:33:28 +0100 Subject: [PATCH] Older gcc does not support #pragma GCC diagnostic inside functions --- src/video/x11/SDL_x11sym.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index 9fdb20587..fea44c9b8 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -194,7 +194,7 @@ SDL_X11_SYM(Bool,XkbSetDetectableAutoRepeat,(Display* a, Bool b, Bool* c),(a,b,c #endif /* XKeycodeToKeysym is a deprecated function */ -#if defined(__GNUC__) || defined(__clang__) +#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) || defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif @@ -203,7 +203,7 @@ SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,unsigned int b,int c),(a,b,c),re #else SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,KeyCode b,int c),(a,b,c),return) #endif -#if defined(__GNUC__) || defined(__clang__) +#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) || defined(__clang__) #pragma GCC diagnostic pop #endif