From 3f9f0027bc86ad6e8f293a90e778ed8911cb9158 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 24 Mar 2015 14:40:31 -0400 Subject: [PATCH] Patched to compile on C89 compilers. --- src/events/SDL_quit.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/events/SDL_quit.c b/src/events/SDL_quit.c index 898e33a7383b6..c808122024a6b 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)