From 53e22e4be8c462f15f31c9c906a412fcefd731cf Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 1 Oct 2016 11:22:39 -0700 Subject: [PATCH] Only use GCC pragmas when we're building with GCC --- src/SDL_error.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SDL_error.c b/src/SDL_error.c index 452d5313c1229..804a1eb389c25 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -116,8 +116,10 @@ SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) return -1; } +#ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" +#endif /* This function has a bit more overhead than most error functions so that it supports internationalization and thread-safe errors. */ @@ -218,7 +220,9 @@ SDL_GetErrorMsg(char *errstr, int maxlen) } return (errstr); } +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif /* Available for backwards compatibility */ const char *