music_opus.c
changeset 918 05c9e6169a89
parent 917 a94168f3fc7f
child 926 d6c9518fb5ee
equal deleted inserted replaced
917:a94168f3fc7f 918:05c9e6169a89
    25 
    25 
    26 #include "SDL_loadso.h"
    26 #include "SDL_loadso.h"
    27 
    27 
    28 #include "music_opus.h"
    28 #include "music_opus.h"
    29 
    29 
       
    30 #if defined(OPUS_HEADER)
       
    31 #include OPUS_HEADER
       
    32 #else
    30 #include <opus/opusfile.h>
    33 #include <opus/opusfile.h>
       
    34 #endif
    31 
    35 
    32 typedef struct {
    36 typedef struct {
    33     int loaded;
    37     int loaded;
    34     void *handle;
    38     void *handle;
    35     OggOpusFile *(*op_open_callbacks)(void *,const OpusFileCallbacks *,const unsigned char *,size_t,int *);
    39     OggOpusFile *(*op_open_callbacks)(void *,const OpusFileCallbacks *,const unsigned char *,size_t,int *);
    63         }
    67         }
    64 #elif defined(__MACOSX__)
    68 #elif defined(__MACOSX__)
    65         extern OggOpusFile *op_open_callbacks(void *,const OpusFileCallbacks *,const unsigned char *,size_t,int *) __attribute__((weak_import));
    69         extern OggOpusFile *op_open_callbacks(void *,const OpusFileCallbacks *,const unsigned char *,size_t,int *) __attribute__((weak_import));
    66         if (op_open_callbacks == NULL) {
    70         if (op_open_callbacks == NULL) {
    67             /* Missing weakly linked framework */
    71             /* Missing weakly linked framework */
    68             Mix_SetError("Missing Opus.framework");
    72             Mix_SetError("Missing OpusFile.framework");
    69             return -1;
    73             return -1;
    70         }
    74         }
    71 #endif
    75 #endif
    72         FUNCTION_LOADER(op_open_callbacks, OggOpusFile *(*)(void *,const OpusFileCallbacks *,const unsigned char *,size_t,int *))
    76         FUNCTION_LOADER(op_open_callbacks, OggOpusFile *(*)(void *,const OpusFileCallbacks *,const unsigned char *,size_t,int *))
    73         FUNCTION_LOADER(op_free, void (*)(OggOpusFile *))
    77         FUNCTION_LOADER(op_free, void (*)(OggOpusFile *))