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 3516 - fix build on illumos
Summary: fix build on illumos
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: don't know
Hardware: All Other
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-11 20:41 UTC by Sylvain
Modified: 2016-12-26 09:57 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 Sylvain 2016-12-11 20:41:44 UTC
trivial patch to fix the build on illumos

 -Werror=declaration-after-statement

https://gist.github.com/wiedi/15b71456667f7aa2a7f8815663723bb3


--- src/audio/sun/SDL_sunaudio.c.orig	2016-10-20 03:56:26.000000000 +0000
+++ src/audio/sun/SDL_sunaudio.c
@@ -193,6 +193,10 @@ SUNAUDIO_CloseDevice(_THIS)
 static int
 SUNAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
 {
+#ifdef AUDIO_SETINFO
+    int enc;
+#endif
+    int desired_freq = 0;
     const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT);
     SDL_AudioFormat format = 0;
     audio_info_t info;
@@ -220,10 +224,7 @@ SUNAUDIO_OpenDevice(_THIS, void *handle,
         return SDL_SetError("Couldn't open %s: %s", devname, strerror(errno));
     }
 
-#ifdef AUDIO_SETINFO
-    int enc;
-#endif
-    int desired_freq = this->spec.freq;
+    desired_freq = this->spec.freq;
 
     /* Determine the audio parameters from the AudioSpec */
     switch (SDL_AUDIO_BITSIZE(this->spec.format)) {
Comment 1 Sam Lantinga 2016-12-26 09:57:41 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/2caf713d7ad8