dynamic_flac.c
changeset 629 87c536d57d92
parent 617 87116a42526e
child 711 f40c5ac95b12
equal deleted inserted replaced
628:461e2724372b 629:87c536d57d92
    23 */
    23 */
    24 
    24 
    25 #ifdef FLAC_MUSIC
    25 #ifdef FLAC_MUSIC
    26 
    26 
    27 #include "SDL_loadso.h"
    27 #include "SDL_loadso.h"
    28 
    28 #include "SDL_mixer.h"
    29 #include "dynamic_flac.h"
    29 #include "dynamic_flac.h"
    30 
    30 
    31 flac_loader flac = {
    31 flac_loader flac = {
    32     0, NULL
    32     0, NULL
    33 };
    33 };
   140 }
   140 }
   141 #else
   141 #else
   142 int Mix_InitFLAC()
   142 int Mix_InitFLAC()
   143 {
   143 {
   144     if ( flac.loaded == 0 ) {
   144     if ( flac.loaded == 0 ) {
       
   145 #ifdef __MACOSX__
       
   146         extern FLAC__StreamDecoder *FLAC__stream_decoder_new(void) __attribute__((weak_import));
       
   147         if ( FLAC__stream_decoder_new == NULL )
       
   148         {
       
   149             /* Missing weakly linked framework */
       
   150             Mix_SetError("Missing FLAC.framework");
       
   151             return -1;
       
   152         }
       
   153 #endif // __MACOSX__
       
   154 
   145         flac.FLAC__stream_decoder_new = FLAC__stream_decoder_new;
   155         flac.FLAC__stream_decoder_new = FLAC__stream_decoder_new;
   146         flac.FLAC__stream_decoder_delete = FLAC__stream_decoder_delete;
   156         flac.FLAC__stream_decoder_delete = FLAC__stream_decoder_delete;
   147         flac.FLAC__stream_decoder_init_stream =
   157         flac.FLAC__stream_decoder_init_stream =
   148                             FLAC__stream_decoder_init_stream;
   158                             FLAC__stream_decoder_init_stream;
   149         flac.FLAC__stream_decoder_finish = FLAC__stream_decoder_finish;
   159         flac.FLAC__stream_decoder_finish = FLAC__stream_decoder_finish;