Skip to content

Commit

Permalink
Only use GCC pragmas when we're building with GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 1, 2016
1 parent a42c396 commit 53e22e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SDL_error.c
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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 *
Expand Down

0 comments on commit 53e22e4

Please sign in to comment.