Skip to content

Commit

Permalink
Fixed normal linking with libmikmod and linking with earlier versions…
Browse files Browse the repository at this point in the history
… of libmikmod.
  • Loading branch information
slouken committed Jul 22, 2012
1 parent cfe60fd commit 3188b77
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dynamic_mod.c
Expand Up @@ -97,8 +97,8 @@ int Mix_InitMOD()
(void (*)(void*))
SDL_LoadFunction(mikmod.handle, "MikMod_free");
if ( mikmod.MikMod_free == NULL ) {
SDL_UnloadObject(mikmod.handle);
return -1;
/* libmikmod 3.1 and earlier doesn't have it */
mikmod.MikMod_free = free;
}
mikmod.Player_Active =
(BOOL (*)(void))
Expand Down Expand Up @@ -246,6 +246,11 @@ int Mix_InitMOD()
mikmod.MikMod_RegisterDriver = MikMod_RegisterDriver;
mikmod.MikMod_errno = &MikMod_errno;
mikmod.MikMod_strerror = MikMod_strerror;
#if LIBMIKMOD_VERSION < ((3<<16)|(2<<8))
mikmod.MikMod_free = free;
#else
mikmod.MikMod_free = MikMod_free;
#endif
mikmod.Player_Active = Player_Active;
mikmod.Player_Free = Player_Free;
mikmod.Player_LoadGeneric = Player_LoadGeneric;
Expand Down

0 comments on commit 3188b77

Please sign in to comment.