src/audio/alsa/SDL_alsa_audio.c
changeset 939 c7c04f811994
parent 865 92615154bb68
child 942 41a59de7f2ed
equal deleted inserted replaced
938:fa2ce068b0b6 939:c7c04f811994
    40 #include "SDL_audio_c.h"
    40 #include "SDL_audio_c.h"
    41 #include "SDL_timer.h"
    41 #include "SDL_timer.h"
    42 #include "SDL_alsa_audio.h"
    42 #include "SDL_alsa_audio.h"
    43 
    43 
    44 #ifdef ALSA_DYNAMIC
    44 #ifdef ALSA_DYNAMIC
       
    45 #ifdef USE_DLVSYM
    45 #define __USE_GNU
    46 #define __USE_GNU
       
    47 #endif
    46 #include <dlfcn.h>
    48 #include <dlfcn.h>
    47 #include "SDL_name.h"
    49 #include "SDL_name.h"
    48 #include "SDL_loadso.h"
    50 #include "SDL_loadso.h"
    49 #else
    51 #else
    50 #define SDL_NAME(X)	X
    52 #define SDL_NAME(X)	X
   132 	if (alsa_handle) {
   134 	if (alsa_handle) {
   133 		alsa_loaded = 1;
   135 		alsa_loaded = 1;
   134 		retval = 0;
   136 		retval = 0;
   135 		for (i = 0; i < SDL_TABLESIZE(alsa_functions); i++) {
   137 		for (i = 0; i < SDL_TABLESIZE(alsa_functions); i++) {
   136 /*			*alsa_functions[i].func = SDL_LoadFunction(alsa_handle,alsa_functions[i].name);*/
   138 /*			*alsa_functions[i].func = SDL_LoadFunction(alsa_handle,alsa_functions[i].name);*/
       
   139 #ifdef USE_DLVSYM
   137 			*alsa_functions[i].func = dlvsym(alsa_handle,alsa_functions[i].name,"ALSA_0.9");
   140 			*alsa_functions[i].func = dlvsym(alsa_handle,alsa_functions[i].name,"ALSA_0.9");
       
   141 			if (!*alsa_functions[i].func)
       
   142 #endif
       
   143 				*alsa_functions[i].func = dlsym(alsa_handle,alsa_functions[i].name);
   138 			if (!*alsa_functions[i].func) {
   144 			if (!*alsa_functions[i].func) {
   139 				retval = -1;
   145 				retval = -1;
   140 				UnloadALSALibrary();
   146 				UnloadALSALibrary();
   141 				break;
   147 				break;
   142 			}
   148 			}