dynamic_mod.c
changeset 588 2ebb0d016f27
parent 587 56cad6484b04
child 601 05123263dab3
     1.1 --- a/dynamic_mod.c	Sun Jul 22 16:13:27 2012 -0700
     1.2 +++ b/dynamic_mod.c	Sun Jul 22 16:33:37 2012 -0700
     1.3 @@ -97,8 +97,8 @@
     1.4  			(void (*)(void*))
     1.5  			SDL_LoadFunction(mikmod.handle, "MikMod_free");
     1.6  		if ( mikmod.MikMod_free == NULL ) {
     1.7 -			SDL_UnloadObject(mikmod.handle);
     1.8 -			return -1;
     1.9 +			/* libmikmod 3.1 and earlier doesn't have it */
    1.10 +			mikmod.MikMod_free = free;
    1.11  		}
    1.12  		mikmod.Player_Active =
    1.13  			(BOOL (*)(void))
    1.14 @@ -246,6 +246,11 @@
    1.15  		mikmod.MikMod_RegisterDriver = MikMod_RegisterDriver;
    1.16  		mikmod.MikMod_errno = &MikMod_errno;
    1.17  		mikmod.MikMod_strerror = MikMod_strerror;
    1.18 +#if LIBMIKMOD_VERSION < ((3<<16)|(2<<8))
    1.19 +		mikmod.MikMod_free = free;
    1.20 +#else
    1.21 +		mikmod.MikMod_free = MikMod_free;
    1.22 +#endif
    1.23  		mikmod.Player_Active = Player_Active;
    1.24  		mikmod.Player_Free = Player_Free;
    1.25  		mikmod.Player_LoadGeneric = Player_LoadGeneric;