dynamic_mod.c
changeset 588 2ebb0d016f27
parent 587 56cad6484b04
child 601 05123263dab3
equal deleted inserted replaced
587:56cad6484b04 588:2ebb0d016f27
    95 		}
    95 		}
    96 		mikmod.MikMod_free =
    96 		mikmod.MikMod_free =
    97 			(void (*)(void*))
    97 			(void (*)(void*))
    98 			SDL_LoadFunction(mikmod.handle, "MikMod_free");
    98 			SDL_LoadFunction(mikmod.handle, "MikMod_free");
    99 		if ( mikmod.MikMod_free == NULL ) {
    99 		if ( mikmod.MikMod_free == NULL ) {
   100 			SDL_UnloadObject(mikmod.handle);
   100 			/* libmikmod 3.1 and earlier doesn't have it */
   101 			return -1;
   101 			mikmod.MikMod_free = free;
   102 		}
   102 		}
   103 		mikmod.Player_Active =
   103 		mikmod.Player_Active =
   104 			(BOOL (*)(void))
   104 			(BOOL (*)(void))
   105 			SDL_LoadFunction(mikmod.handle, "Player_Active");
   105 			SDL_LoadFunction(mikmod.handle, "Player_Active");
   106 		if ( mikmod.Player_Active == NULL ) {
   106 		if ( mikmod.Player_Active == NULL ) {
   244 		mikmod.MikMod_Init = MikMod_Init;
   244 		mikmod.MikMod_Init = MikMod_Init;
   245 		mikmod.MikMod_RegisterAllLoaders = MikMod_RegisterAllLoaders;
   245 		mikmod.MikMod_RegisterAllLoaders = MikMod_RegisterAllLoaders;
   246 		mikmod.MikMod_RegisterDriver = MikMod_RegisterDriver;
   246 		mikmod.MikMod_RegisterDriver = MikMod_RegisterDriver;
   247 		mikmod.MikMod_errno = &MikMod_errno;
   247 		mikmod.MikMod_errno = &MikMod_errno;
   248 		mikmod.MikMod_strerror = MikMod_strerror;
   248 		mikmod.MikMod_strerror = MikMod_strerror;
       
   249 #if LIBMIKMOD_VERSION < ((3<<16)|(2<<8))
       
   250 		mikmod.MikMod_free = free;
       
   251 #else
       
   252 		mikmod.MikMod_free = MikMod_free;
       
   253 #endif
   249 		mikmod.Player_Active = Player_Active;
   254 		mikmod.Player_Active = Player_Active;
   250 		mikmod.Player_Free = Player_Free;
   255 		mikmod.Player_Free = Player_Free;
   251 		mikmod.Player_LoadGeneric = Player_LoadGeneric;
   256 		mikmod.Player_LoadGeneric = Player_LoadGeneric;
   252 		mikmod.Player_SetPosition = Player_SetPosition;
   257 		mikmod.Player_SetPosition = Player_SetPosition;
   253 		mikmod.Player_SetVolume = Player_SetVolume;
   258 		mikmod.Player_SetVolume = Player_SetVolume;