Patched to compile on C89 compilers.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 24 Mar 2015 14:40:31 -0400
changeset 94360af69dab9bb6
parent 9435 0979c3e31211
child 9437 569cfb86df95
Patched to compile on C89 compilers.
src/events/SDL_quit.c
     1.1 --- a/src/events/SDL_quit.c	Tue Mar 24 14:36:36 2015 -0400
     1.2 +++ b/src/events/SDL_quit.c	Tue Mar 24 14:40:31 2015 -0400
     1.3 @@ -46,15 +46,9 @@
     1.4  #endif /* HAVE_SIGNAL_H */
     1.5  
     1.6  /* Public functions */
     1.7 -int
     1.8 -SDL_QuitInit(void)
     1.9 +static int
    1.10 +SDL_QuitInit_Internal(void)
    1.11  {
    1.12 -    const char *hint = SDL_GetHint(SDL_HINT_NO_SIGNAL_HANDLERS);
    1.13 -    disable_signals = hint && (SDL_atoi(hint) == 1);
    1.14 -    if (disable_signals) {
    1.15 -        return 0;
    1.16 -    }
    1.17 -
    1.18  #ifdef HAVE_SIGACTION
    1.19      struct sigaction action;
    1.20      sigaction(SIGINT, NULL, &action);
    1.21 @@ -92,13 +86,20 @@
    1.22      return 0;
    1.23  }
    1.24  
    1.25 -void
    1.26 -SDL_QuitQuit(void)
    1.27 +int
    1.28 +SDL_QuitInit(void)
    1.29  {
    1.30 -    if (disable_signals) {
    1.31 -        return;
    1.32 +    const char *hint = SDL_GetHint(SDL_HINT_NO_SIGNAL_HANDLERS);
    1.33 +    disable_signals = hint && (SDL_atoi(hint) == 1);
    1.34 +    if (!disable_signals) {
    1.35 +        return SDL_QuitInit_Internal();
    1.36      }
    1.37 +    return 0;
    1.38 +}
    1.39  
    1.40 +static void
    1.41 +SDL_QuitQuit_Internal(void)
    1.42 +{
    1.43  #ifdef HAVE_SIGACTION
    1.44      struct sigaction action;
    1.45      sigaction(SIGINT, NULL, &action);
    1.46 @@ -123,6 +124,14 @@
    1.47  #endif /* HAVE_SIGNAL_H */
    1.48  }
    1.49  
    1.50 +void
    1.51 +SDL_QuitQuit(void)
    1.52 +{
    1.53 +    if (!disable_signals) {
    1.54 +        SDL_QuitQuit_Internal();
    1.55 +    }
    1.56 +}
    1.57 +
    1.58  /* This function returns 1 if it's okay to close the application window */
    1.59  int
    1.60  SDL_SendQuit(void)