From 2a25b69ba580ff63ede93f2b19fa1bca09dab484 Mon Sep 17 00:00:00 2001 From: Anthony Heathcoat Date: Sat, 2 Jul 2022 20:50:51 -0400 Subject: [PATCH] Check if GNC is defined before checking its value to solve warns in msvc --- include/SDL_assert.h | 2 +- include/begin_code.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SDL_assert.h b/include/SDL_assert.h index 427c4c633..e71cf9792 100644 --- a/include/SDL_assert.h +++ b/include/SDL_assert.h @@ -71,7 +71,7 @@ assert can have unique static variables associated with it. #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ # define SDL_FUNCTION __func__ -#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__)) +#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__)) # define SDL_FUNCTION __FUNCTION__ #else # define SDL_FUNCTION "???" diff --git a/include/begin_code.h b/include/begin_code.h index 6c2f096f8..b3e69e85c 100644 --- a/include/begin_code.h +++ b/include/begin_code.h @@ -34,7 +34,7 @@ #define _begin_code_h #ifndef SDL_DEPRECATED -# if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ +# if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ # define SDL_DEPRECATED __attribute__((deprecated)) # else # define SDL_DEPRECATED