Fixed building with some audio support disabled
authorSam Lantinga <slouken@libsdl.org>
Sun, 08 Nov 2009 17:03:07 +0000
changeset 472463ba3222193
parent 471 f56ee4fcc9d5
child 473 60b7e1c4f6b2
Fixed building with some audio support disabled
dynamic_flac.c
dynamic_mod.c
dynamic_mp3.c
dynamic_ogg.c
mixer.c
     1.1 --- a/dynamic_flac.c	Sun Nov 08 16:39:26 2009 +0000
     1.2 +++ b/dynamic_flac.c	Sun Nov 08 17:03:07 2009 +0000
     1.3 @@ -176,16 +176,4 @@
     1.4  }
     1.5  #endif /* FLAC_DYNAMIC */
     1.6  
     1.7 -#else
     1.8 -
     1.9 -int Mix_InitFLAC()
    1.10 -{
    1.11 -	Mix_SetError("FLAC audio is not supported");
    1.12 -	return -1;
    1.13 -}
    1.14 -
    1.15 -void Mix_QuitFLAC()
    1.16 -{
    1.17 -}
    1.18 -
    1.19  #endif /* FLAC_MUSIC */
     2.1 --- a/dynamic_mod.c	Sun Nov 08 16:39:26 2009 +0000
     2.2 +++ b/dynamic_mod.c	Sun Nov 08 17:03:07 2009 +0000
     2.3 @@ -273,16 +273,4 @@
     2.4  }
     2.5  #endif /* MOD_DYNAMIC */
     2.6  
     2.7 -#else
     2.8 -
     2.9 -int Mix_InitMOD()
    2.10 -{
    2.11 -	Mix_SetError("MOD audio is not supported");
    2.12 -	return -1;
    2.13 -}
    2.14 -
    2.15 -void Mix_QuitMOD()
    2.16 -{
    2.17 -}
    2.18 -
    2.19  #endif /* MOD_MUSIC */
     3.1 --- a/dynamic_mp3.c	Sun Nov 08 16:39:26 2009 +0000
     3.2 +++ b/dynamic_mp3.c	Sun Nov 08 17:03:07 2009 +0000
     3.3 @@ -177,16 +177,4 @@
     3.4  }
     3.5  #endif /* MP3_DYNAMIC */
     3.6  
     3.7 -#else
     3.8 -
     3.9 -int Mix_InitMP3()
    3.10 -{
    3.11 -	Mix_SetError("MP3 audio is not supported");
    3.12 -	return -1;
    3.13 -}
    3.14 -
    3.15 -void Mix_QuitMP3()
    3.16 -{
    3.17 -}
    3.18 -
    3.19  #endif /* MP3_MUSIC */
     4.1 --- a/dynamic_ogg.c	Sun Nov 08 16:39:26 2009 +0000
     4.2 +++ b/dynamic_ogg.c	Sun Nov 08 17:03:07 2009 +0000
     4.3 @@ -125,16 +125,4 @@
     4.4  }
     4.5  #endif /* OGG_DYNAMIC */
     4.6  
     4.7 -#else
     4.8 -
     4.9 -int Mix_InitOgg()
    4.10 -{
    4.11 -	Mix_SetError("Ogg Vorbis audio is not supported");
    4.12 -	return -1;
    4.13 -}
    4.14 -
    4.15 -void Mix_QuitOgg()
    4.16 -{
    4.17 -}
    4.18 -
    4.19  #endif /* OGG_MUSIC */
     5.1 --- a/mixer.c	Sun Nov 08 16:39:26 2009 +0000
     5.2 +++ b/mixer.c	Sun Nov 08 17:03:07 2009 +0000
     5.3 @@ -145,24 +145,40 @@
     5.4  	int result = 0;
     5.5  
     5.6  	if ((flags & MIX_INIT_FLAC) && !(initialized & MIX_INIT_FLAC)) {
     5.7 +#ifdef FLAC_MUSIC
     5.8  		if (Mix_InitFLAC() == 0) {
     5.9  			result |= MIX_INIT_FLAC;
    5.10  		}
    5.11 +#else
    5.12 +		Mix_SetError("Mixer not built with FLAC support");
    5.13 +#endif
    5.14  	}
    5.15  	if ((flags & MIX_INIT_MOD) && !(initialized & MIX_INIT_MOD)) {
    5.16 +#ifdef MOD_MUSIC
    5.17  		if (Mix_InitMOD() == 0) {
    5.18  			result |= MIX_INIT_MOD;
    5.19  		}
    5.20 +#else
    5.21 +		Mix_SetError("Mixer not built with MOD support");
    5.22 +#endif
    5.23  	}
    5.24  	if ((flags & MIX_INIT_MP3) && !(initialized & MIX_INIT_MP3)) {
    5.25 +#ifdef MP3_MUSIC
    5.26  		if (Mix_InitMP3() == 0) {
    5.27  			result |= MIX_INIT_MP3;
    5.28  		}
    5.29 +#else
    5.30 +		Mix_SetError("Mixer not built with MP3 support");
    5.31 +#endif
    5.32  	}
    5.33  	if ((flags & MIX_INIT_OGG) && !(initialized & MIX_INIT_OGG)) {
    5.34 +#ifdef OGG_MUSIC
    5.35  		if (Mix_InitOgg() == 0) {
    5.36  			result |= MIX_INIT_OGG;
    5.37  		}
    5.38 +#else
    5.39 +		Mix_SetError("Mixer not built with Ogg Vorbis support");
    5.40 +#endif
    5.41  	}
    5.42  	initialized |= result;
    5.43  
    5.44 @@ -171,18 +187,26 @@
    5.45  
    5.46  void Mix_Quit()
    5.47  {
    5.48 +#ifdef FLAC_MUSIC
    5.49  	if (initialized & MIX_INIT_FLAC) {
    5.50  		Mix_QuitFLAC();
    5.51  	}
    5.52 +#endif
    5.53 +#ifdef MOD_MUSIC
    5.54  	if (initialized & MIX_INIT_MOD) {
    5.55  		Mix_QuitMOD();
    5.56  	}
    5.57 +#endif
    5.58 +#ifdef MP3_MUSIC
    5.59  	if (initialized & MIX_INIT_MP3) {
    5.60  		Mix_QuitMP3();
    5.61  	}
    5.62 +#endif
    5.63 +#ifdef OGG_MUSIC
    5.64  	if (initialized & MIX_INIT_OGG) {
    5.65  		Mix_QuitOgg();
    5.66  	}
    5.67 +#endif
    5.68  	initialized = 0;
    5.69  }
    5.70