diff --git a/CMakeLists.txt b/CMakeLists.txt index e9f5c6f215..69cbc039b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,10 @@ if(APPLE) if (PLASMA_MAC_UNIVERSAL) set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)") endif() + + if(CMAKE_SYSTEM_VERSION VERSION_LESS 10) # Darwin 10 == Mac OS X 10.6 + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + endif() endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") endif(APPLE) diff --git a/Sources/Plasma/CoreLib/CMakeLists.txt b/Sources/Plasma/CoreLib/CMakeLists.txt index e300eede33..bf6b0e1464 100644 --- a/Sources/Plasma/CoreLib/CMakeLists.txt +++ b/Sources/Plasma/CoreLib/CMakeLists.txt @@ -21,7 +21,7 @@ set(CoreLib_SOURCES plLoadMask.cpp plProduct.cpp plViewTransform.cpp - hsWindows.cpp + $<$:hsWindows.cpp> ) if(CMAKE_USE_WIN32_THREADS_INIT) diff --git a/Sources/Plasma/CoreLib/hsWindows.cpp b/Sources/Plasma/CoreLib/hsWindows.cpp index 5b7bfc0c28..f6274bf91b 100644 --- a/Sources/Plasma/CoreLib/hsWindows.cpp +++ b/Sources/Plasma/CoreLib/hsWindows.cpp @@ -40,8 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#ifdef HS_BUILD_FOR_WIN32 - #include "HeadSpin.h" #include "hsWindows.h" #include @@ -93,5 +91,3 @@ const RTL_OSVERSIONINFOEXW& hsGetWindowsVersion() } return s_WinVer; } - -#endif diff --git a/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.cpp b/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.cpp index 401001a7af..612716f878 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.cpp @@ -79,6 +79,10 @@ ST::string kDefaultDeviceMagic = ST_LITERAL("(Default Device)"); #define MAX_NUM_SOURCES 128 #define UPDATE_TIME_MS 100 +#ifndef ALC_ALL_DEVICES_SPECIFIER +# define ALC_ALL_DEVICES_SPECIFIER 0x1013 +#endif + plProfile_CreateTimer("EAX Update", "Sound", SoundEAXUpdate); plProfile_CreateTimer("Soft Update", "Sound", SoundSoftUpdate); plProfile_CreateCounter("Max Sounds", "Sound", SoundMaxNum); diff --git a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp index 2935dce6da..69baa5cbae 100644 --- a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp +++ b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp @@ -43,6 +43,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include +#ifdef HS_BUILD_FOR_APPLE +# include +# include +#endif + #include "plUnifiedTime.h" #include "hsStream.h" @@ -107,10 +112,21 @@ void plUnifiedTime::ToCurrentTime() struct timespec ts; #if defined(HS_BUILD_FOR_APPLE) - // timespec_get is only supported since macOS 10.15, - // but clock_gettime exists since macOS 10.12. - int res = clock_gettime(CLOCK_REALTIME, &ts); - hsAssert(res == 0, "clock_gettime failed"); +#if defined(HAVE_BUILTIN_AVAILABLE) && MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 + if (__builtin_available(macOS 10.15, *)) { + // timespec_get is only supported since macOS 10.15 + int res = timespec_get(&ts, TIME_UTC); + hsAssert(res != 0, "timespec_get failed"); + } else +#endif + { + struct timeval tv; + int res = gettimeofday(&tv, nullptr); + hsAssert(res == 0, "gettimeofday failed"); + + ts.tv_sec = tv.tv_sec; + ts.tv_nsec = tv.tv_usec * 1000; + } #else int res = timespec_get(&ts, TIME_UTC); hsAssert(res != 0, "timespec_get failed");