From 40bf8a421ea5d7804f73ec3aa6e8aa7f9e1e123b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 23 Mar 2018 11:28:10 +0200 Subject: [PATCH] User's OpenAL library has precedence over Apple's framework https://forum.zdoom.org/viewtopic.php?t=59920 --- src/sound/oalsound.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index 033f40b89e..e973050b08 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -62,14 +62,22 @@ CVAR (String, snd_alresampler, "Default", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) #ifdef _WIN32 #define OPENALLIB "openal32.dll" -#elif defined(__APPLE__) -#define OPENALLIB "OpenAL.framework/OpenAL" #elif defined(__OpenBSD__) #define OPENALLIB "libopenal.so" #else #define OPENALLIB "libopenal.so.1" #endif +#ifdef __APPLE__ +// User's library (like OpenAL Soft installed manually or via Homebrew) has precedence +// over Apple's OpenAL framework which lacks several important features +#define OPENALLIB1 "libopenal.1.dylib" +#define OPENALLIB2 "OpenAL.framework/OpenAL" +#else // !__APPLE__ +#define OPENALLIB1 NicePath("$PROGDIR/" OPENALLIB) +#define OPENALLIB2 OPENALLIB +#endif + bool IsOpenALPresent() { #ifdef NO_OPENAL @@ -83,7 +91,7 @@ bool IsOpenALPresent() if (!done) { done = true; - cached_result = OpenALModule.Load({NicePath("$PROGDIR/" OPENALLIB), OPENALLIB}); + cached_result = OpenALModule.Load({OPENALLIB1, OPENALLIB2}); } return cached_result; #endif