macOS: Fix very old Xcode build

This commit is contained in:
Vicki Pfau 2022-08-30 00:20:13 -07:00
parent 0b50e7163e
commit e2084b4a98
2 changed files with 11 additions and 0 deletions

View File

@ -240,6 +240,13 @@ if(APPLE)
if(NOT CMAKE_SYSTEM_VERSION VERSION_LESS "10.0") # Darwin 10.x is Mac OS X 10.6
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.6")
endif()
# Not supported until Xcode 9
if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "9")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__STDC_NO_THREADS__=1")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_NO_THREADS__=1")
endif()
endif()
if(NOT HAIKU AND NOT MSVC AND NOT PSP2)

View File

@ -84,6 +84,10 @@ typedef intptr_t ssize_t;
#define M_PI 3.141592654f
#endif
#if !defined(__cplusplus) && !defined(static_assert)
#define static_assert(X, C) _Static_assert((X), C)
#endif
#if !defined(_MSC_VER) && (defined(__llvm__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
#define ATOMIC_STORE(DST, SRC) __atomic_store_n(&DST, SRC, __ATOMIC_RELEASE)
#define ATOMIC_LOAD(DST, SRC) DST = __atomic_load_n(&SRC, __ATOMIC_ACQUIRE)