From 663fcfeb9a3e57d94f8facfa513c6014c24caf81 Mon Sep 17 00:00:00 2001 From: janwas Date: Thu, 16 Jul 2009 16:48:06 +0000 Subject: [PATCH] # macosx compile fix (OpenAL ALC string definition differs on Windows vs OSX) This was SVN commit r7000. --- source/lib/external_libraries/openal.h | 8 ++++++++ source/lib/res/sound/snd_mgr.cpp | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/source/lib/external_libraries/openal.h b/source/lib/external_libraries/openal.h index 84d5add7e0..86738d260f 100644 --- a/source/lib/external_libraries/openal.h +++ b/source/lib/external_libraries/openal.h @@ -30,6 +30,14 @@ # include #endif +// ALC strings (e.g. device and extension names) are typed differently +// between platforms *sigh* +#if OS_MACOSX +typedef ALCubyte* alcString; +#else +typedef ALCchar* alcString; +#endif + #if MSC_VERSION # pragma comment(lib, "openal32.lib") #endif diff --git a/source/lib/res/sound/snd_mgr.cpp b/source/lib/res/sound/snd_mgr.cpp index 0361ea79b3..20a03aa7cf 100644 --- a/source/lib/res/sound/snd_mgr.cpp +++ b/source/lib/res/sound/snd_mgr.cpp @@ -248,7 +248,7 @@ static LibError alc_init() #if OS_WIN __try { - alc_dev = alcOpenDevice((ALCchar*)alc_dev_name); + alc_dev = alcOpenDevice((alcString)alc_dev_name); } // if invalid handle, handle it; otherwise, continue handler search. __except(GetExceptionCode() == EXCEPTION_INVALID_HANDLE) @@ -256,7 +256,7 @@ static LibError alc_init() // ignore } #else - alc_dev = alcOpenDevice(alc_dev_name); + alc_dev = alcOpenDevice((alcString)alc_dev_name); #endif if(alc_dev) @@ -686,7 +686,7 @@ static const char* devs; */ LibError snd_dev_prepare_enum() { - if(alcIsExtensionPresent(0, (ALCchar*)"ALC_ENUMERATION_EXT") != AL_TRUE) + if(alcIsExtensionPresent(0, (alcString)"ALC_ENUMERATION_EXT") != AL_TRUE) WARN_RETURN(ERR::NO_SYS); devs = (const char*)alcGetString(0, ALC_DEVICE_SPECIFIER);