From 380099484f5f4389a5c886ca5175fabd6229bf83 Mon Sep 17 00:00:00 2001 From: sezero Date: Fri, 27 Dec 2013 12:00:21 +0000 Subject: [PATCH] snd_mikmod.c: compile-time sanity checks for libmikmod version. git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@883 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/snd_mikmod.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Quake/snd_mikmod.c b/Quake/snd_mikmod.c index 4b44d618..3ae5b864 100644 --- a/Quake/snd_mikmod.c +++ b/Quake/snd_mikmod.c @@ -1,6 +1,5 @@ /* * tracker music (module file) decoding support using libmikmod - * * Copyright (C) 2013 O.Sezer * * This program is free software; you can redistribute it and/or modify @@ -27,6 +26,15 @@ #include "snd_mikmod.h" #include +#if ((LIBMIKMOD_VERSION+0) < 0x030105) +#error libmikmod version is way too old and unusable. +#endif +#if (LIBMIKMOD_VERSION < 0x030107) /* ancient libmikmod */ +#define S_MIKMOD_initlib(c) MikMod_Init() +#else +#define S_MIKMOD_initlib(c) MikMod_Init(c) +#endif + #ifndef DMODE_NOISEREDUCTION #define DMODE_NOISEREDUCTION 0x1000 /* Low pass filtering */ #endif @@ -97,7 +105,7 @@ static qboolean S_MIKMOD_CodecInitialize (void) MikMod_RegisterDriver(&drv_nos); /* only need the "nosound" driver, none else */ MikMod_RegisterAllLoaders(); - if (MikMod_Init(NULL)) + if (S_MIKMOD_initlib(NULL)) { Con_DPrintf("Could not initialize MikMod: %s\n", MikMod_strerror(MikMod_errno)); return false;