From 484149573be1bd579ea7f4ee978c9b944db63888 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Thu, 22 Mar 2018 14:31:46 -0500 Subject: [PATCH] Allow loading system OpenAL library on macOS again In May 2017 the library loading was limited to *.dylib but the macOS system OpenAL framework does not have dylib extension. So allow loading files from /System/Library/Frameworks/ as libraries even without dylib extension. This is checked in Sys_DllExtension() so that QVM filesystem access will not allow writing files to /System/Library/Frameworks/ even if homepath is changed to include it. (Admittedly it doesn't fit the function name but fits the function description and current usage.) --- code/sys/sys_unix.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c index ebba37e8..1043b9a4 100644 --- a/code/sys/sys_unix.c +++ b/code/sys/sys_unix.c @@ -928,6 +928,14 @@ qboolean Sys_DllExtension( const char *name ) { return qtrue; } +#ifdef __APPLE__ + // Allow system frameworks without dylib extensions + // i.e., /System/Library/Frameworks/OpenAL.framework/OpenAL + if ( strncmp( name, "/System/Library/Frameworks/", 27 ) == 0 ) { + return qtrue; + } +#endif + // Check for format of filename.so.1.2.3 p = strstr( name, DLL_EXT "." );