Patched to compile on C89 compilers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
diff --git a/src/events/SDL_quit.c b/src/events/SDL_quit.c
index 898e33a..c808122 100644
--- a/src/events/SDL_quit.c
+++ b/src/events/SDL_quit.c
@@ -46,15 +46,9 @@ SDL_HandleSIG(int sig)
#endif /* HAVE_SIGNAL_H */
/* Public functions */
-int
-SDL_QuitInit(void)
+static int
+SDL_QuitInit_Internal(void)
{
- const char *hint = SDL_GetHint(SDL_HINT_NO_SIGNAL_HANDLERS);
- disable_signals = hint && (SDL_atoi(hint) == 1);
- if (disable_signals) {
- return 0;
- }
-
#ifdef HAVE_SIGACTION
struct sigaction action;
sigaction(SIGINT, NULL, &action);
@@ -92,13 +86,20 @@ SDL_QuitInit(void)
return 0;
}
-void
-SDL_QuitQuit(void)
+int
+SDL_QuitInit(void)
{
- if (disable_signals) {
- return;
+ const char *hint = SDL_GetHint(SDL_HINT_NO_SIGNAL_HANDLERS);
+ disable_signals = hint && (SDL_atoi(hint) == 1);
+ if (!disable_signals) {
+ return SDL_QuitInit_Internal();
}
+ return 0;
+}
+static void
+SDL_QuitQuit_Internal(void)
+{
#ifdef HAVE_SIGACTION
struct sigaction action;
sigaction(SIGINT, NULL, &action);
@@ -123,6 +124,14 @@ SDL_QuitQuit(void)
#endif /* HAVE_SIGNAL_H */
}
+void
+SDL_QuitQuit(void)
+{
+ if (!disable_signals) {
+ SDL_QuitQuit_Internal();
+ }
+}
+
/* This function returns 1 if it's okay to close the application window */
int
SDL_SendQuit(void)