diff --git a/src/Graphics_D3D11.c b/src/Graphics_D3D11.c index b41aa1a6b..da40d49d2 100644 --- a/src/Graphics_D3D11.c +++ b/src/Graphics_D3D11.c @@ -136,7 +136,7 @@ static void CreateDevice(void) { // So for the sake of simplicity and since only a few old GPUs don't support feature level 10 anyways // https://walbourn.github.io/direct3d-feature-levels/ // https://github.com/MonoGame/MonoGame/issues/5789 - // I decided to just not support GPUs that do not support at least feature level 10 + // Just don't support GPUs that do not support at least feature level 10 if (fl < D3D_FEATURE_LEVEL_10_0) Logger_FailToStart("Your GPU is too old to support the Direct3D11 version.\nTry using the Direct3D9 version instead.\n"); diff --git a/src/Platform_Posix.c b/src/Platform_Posix.c index 414011f13..a9ddfdb90 100644 --- a/src/Platform_Posix.c +++ b/src/Platform_Posix.c @@ -72,6 +72,13 @@ cc_bool Platform_ReadonlyFilesystem; #include #endif +#if defined MAC_OS_X_VERSION_MIN_REQUIRED && (MAC_OS_X_VERSION_MIN_REQUIRED < 1040) + /* Really old mac OS versions don't have the dlopen/dlsym API */ + #define USE_NS_DYNLOAD_API +#else + #include +#endif + /*########################################################################################################################* *---------------------------------------------------------Memory----------------------------------------------------------* @@ -430,7 +437,14 @@ void Thread_Run(void** handle, Thread_StartFunc func, int stackSize, const char* if (res) Process_Abort2(res, "Creating thread"); pthread_attr_destroy(&attrs); -#if defined CC_BUILD_LINUX || defined CC_BUILD_HAIKU +#if defined CC_BUILD_LINUX + static int (*FP_pthread_setname_np)(pthread_t thread, const char* name); + /* Not available on old libc versions, so load it dynamically */ + if (!FP_pthread_setname_np) { + FP_pthread_setname_np = dlsym(RTLD_NEXT, "pthread_setname_np"); + } + if (FP_pthread_setname_np) FP_pthread_setname_np(*ptr, name); +#elif defined CC_BUILD_HAIKU extern int pthread_setname_np(pthread_t thread, const char* name); pthread_setname_np(*ptr, name); #elif defined CC_BUILD_FREEBSD || defined CC_BUILD_OPENBSD @@ -1232,7 +1246,7 @@ cc_result Updater_SetNewBuildTime(cc_uint64 timestamp) { /*########################################################################################################################* *-------------------------------------------------------Dynamic lib-------------------------------------------------------* *#########################################################################################################################*/ -#if defined MAC_OS_X_VERSION_MIN_REQUIRED && (MAC_OS_X_VERSION_MIN_REQUIRED < 1040) +#if USE_NS_DYNLOAD_API /* Really old mac OS versions don't have the dlopen/dlsym API */ const cc_string DynamicLib_Ext = String_FromConst(".dylib"); @@ -1269,7 +1283,6 @@ cc_bool DynamicLib_DescribeError(cc_string* dst) { return true; } #else -#include /* TODO: Should we use .bundle instead of .dylib? */ #ifdef CC_BUILD_DARWIN