Fixed bug 1021 (misplaced HAVE_SIGNAL_H condition in playmus.c and playwave.c)
authorSam Lantinga <slouken@libsdl.org>
Thu, 17 Feb 2011 13:33:16 -0800
changeset 5030c77794aaef2
parent 502 209152025a0e
child 504 7a95f36a8bbf
Fixed bug 1021 (misplaced HAVE_SIGNAL_H condition in playmus.c and playwave.c)

Ozkan Sezer 2010-10-08 01:45:34 PDT

The HAVE_SIGNAL_H dependent signal.h includes in playmus.c and playwave.c are
misplaced, because SDL_config.h is not included at that point and this causes
signal.h to be never included. Moving it after the SDL.h and SDL_mixer.h
includes fixes the issue, like in the following.
playmus.c
playwave.c
     1.1 --- a/playmus.c	Thu Feb 17 13:22:41 2011 -0800
     1.2 +++ b/playmus.c	Thu Feb 17 13:33:16 2011 -0800
     1.3 @@ -26,9 +26,6 @@
     1.4  #include <stdio.h>
     1.5  #include <string.h>
     1.6  
     1.7 -#ifdef HAVE_SIGNAL_H
     1.8 -#include <signal.h>
     1.9 -#endif
    1.10  #ifdef unix
    1.11  #include <unistd.h>
    1.12  #endif
    1.13 @@ -36,6 +33,10 @@
    1.14  #include "SDL.h"
    1.15  #include "SDL_mixer.h"
    1.16  
    1.17 +#ifdef HAVE_SIGNAL_H
    1.18 +#include <signal.h>
    1.19 +#endif
    1.20 +
    1.21  
    1.22  static int audio_open = 0;
    1.23  static Mix_Music *music = NULL;
     2.1 --- a/playwave.c	Thu Feb 17 13:22:41 2011 -0800
     2.2 +++ b/playwave.c	Thu Feb 17 13:33:16 2011 -0800
     2.3 @@ -26,9 +26,6 @@
     2.4  #include <stdio.h>
     2.5  #include <string.h>
     2.6  
     2.7 -#ifdef HAVE_SIGNAL_H
     2.8 -#include <signal.h>
     2.9 -#endif
    2.10  #ifdef unix
    2.11  #include <unistd.h>
    2.12  #endif
    2.13 @@ -36,6 +33,10 @@
    2.14  #include "SDL.h"
    2.15  #include "SDL_mixer.h"
    2.16  
    2.17 +#ifdef HAVE_SIGNAL_H
    2.18 +#include <signal.h>
    2.19 +#endif
    2.20 +
    2.21  
    2.22  /*
    2.23   * rcg06132001 various mixer tests. Define the ones you want.