Fix build issue on Win/Haiku.
authorJørgen P. Tjernø <jorgen@valvesoftware.com>
Tue, 12 Feb 2013 12:18:46 -0800
changeset 6867 4c899e841091
parent 6866 e74a4b282450
child 6868 a5a70c0fffb8
Fix build issue on Win/Haiku. This fixes a build issue with C variable declarations in my refcounting change.
src/SDL.c
--- a/src/SDL.c	Tue Feb 12 11:47:31 2013 -0800
+++ b/src/SDL.c	Tue Feb 12 12:18:46 2013 -0800
@@ -48,7 +48,8 @@
 static Uint8 SDL_SubsystemRefCount[ 32 ];
 
 /* Private helper to increment a subsystem's ref counter. */
-static void SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem)
+static void
+SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem)
 {
     int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     SDL_assert(SDL_SubsystemRefCount[subsystem_index] < 255);
@@ -56,7 +57,8 @@
 }
 
 /* Private helper to decrement a subsystem's ref counter. */
-void SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem)
+static void
+SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem)
 {
     int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     if (SDL_SubsystemRefCount[subsystem_index] > 0) {
@@ -68,11 +70,12 @@
 static SDL_bool
 SDL_PrivateShouldInitSubsystem(Uint32 flags, Uint32 subsystem)
 {
+    int subsystem_index;
     if ((flags & subsystem) == 0) {
       return SDL_FALSE;
     }
 
-    int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
+    subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     SDL_assert(SDL_SubsystemRefCount[subsystem_index] < 255);
     return (SDL_SubsystemRefCount[subsystem_index] == 0);
 }