We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1062

Summary: misplaced HAVE_SIGNAL_H condition in playmus.c and playwave.c
Product: SDL_mixer Reporter: Ozkan Sezer <sezeroz>
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: All   
OS: All   

Description Ozkan Sezer 2010-10-08 01:45:34 UTC
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.  Regards.

--- playmus.c~
+++ playmus.c
@@ -26,9 +26,6 @@
 #include <stdio.h>
 #include <string.h>
 
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
 #ifdef unix
 #include <unistd.h>
 #endif
@@ -36,6 +33,10 @@
 #include "SDL.h"
 #include "SDL_mixer.h"
 
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
 
 static int audio_open = 0;
 static Mix_Music *music = NULL;
--- playwave.c~
+++ playwave.c
@@ -26,9 +26,6 @@
 #include <stdio.h>
 #include <string.h>
 
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
 #ifdef unix
 #include <unistd.h>
 #endif
@@ -36,6 +33,10 @@
 #include "SDL.h"
 #include "SDL_mixer.h"
 
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
 
 /*
  * rcg06132001 various mixer tests. Define the ones you want.
Comment 1 Sam Lantinga 2011-02-17 13:33:40 UTC
This is fixed, thanks!
http://hg.libsdl.org/SDL_mixer/rev/0c77794aaef2