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 - misplaced HAVE_SIGNAL_H condition in playmus.c and playwave.c
Summary: misplaced HAVE_SIGNAL_H condition in playmus.c and playwave.c
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-08 01:45 UTC by Ozkan Sezer
Modified: 2011-02-17 13:33 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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