mirror of https://github.com/python/cpython
gh-114099: Modify preprocessor symbol usage to support older macOS SDKs (GH-118073)
Co-authored-by: Joshua Root jmr@macports.org
This commit is contained in:
parent
2aa11cca11
commit
ab99438900
|
@ -0,0 +1 @@
|
||||||
|
iOS preprocessor symbol usage was made compatible with older macOS SDKs.
|
|
@ -246,8 +246,9 @@ PLATFORM_TRIPLET=i386-gnu
|
||||||
# endif
|
# endif
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
# include "TargetConditionals.h"
|
# include "TargetConditionals.h"
|
||||||
# if TARGET_OS_IOS
|
// Older macOS SDKs do not define TARGET_OS_*
|
||||||
# if TARGET_OS_SIMULATOR
|
# if defined(TARGET_OS_IOS) && TARGET_OS_IOS
|
||||||
|
# if defined(TARGET_OS_SIMULATOR) && TARGET_OS_SIMULATOR
|
||||||
# if __x86_64__
|
# if __x86_64__
|
||||||
PLATFORM_TRIPLET=x86_64-iphonesimulator
|
PLATFORM_TRIPLET=x86_64-iphonesimulator
|
||||||
# else
|
# else
|
||||||
|
@ -256,7 +257,8 @@ PLATFORM_TRIPLET=arm64-iphonesimulator
|
||||||
# else
|
# else
|
||||||
PLATFORM_TRIPLET=arm64-iphoneos
|
PLATFORM_TRIPLET=arm64-iphoneos
|
||||||
# endif
|
# endif
|
||||||
# elif TARGET_OS_OSX
|
// Older macOS SDKs do not define TARGET_OS_OSX
|
||||||
|
# elif !defined(TARGET_OS_OSX) || TARGET_OS_OSX
|
||||||
PLATFORM_TRIPLET=darwin
|
PLATFORM_TRIPLET=darwin
|
||||||
# else
|
# else
|
||||||
# error unknown Apple platform
|
# error unknown Apple platform
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
# include <TargetConditionals.h>
|
# include <TargetConditionals.h>
|
||||||
|
// Older macOS SDKs do not define TARGET_OS_OSX
|
||||||
|
# if !defined(TARGET_OS_OSX)
|
||||||
|
# define TARGET_OS_OSX 1
|
||||||
|
# endif
|
||||||
# if TARGET_OS_OSX
|
# if TARGET_OS_OSX
|
||||||
# include <libproc.h>
|
# include <libproc.h>
|
||||||
# include <mach-o/fat.h>
|
# include <mach-o/fat.h>
|
||||||
|
|
|
@ -42,7 +42,8 @@ module marshal
|
||||||
#elif defined(__wasi__)
|
#elif defined(__wasi__)
|
||||||
# define MAX_MARSHAL_STACK_DEPTH 1500
|
# define MAX_MARSHAL_STACK_DEPTH 1500
|
||||||
// TARGET_OS_IPHONE covers any non-macOS Apple platform.
|
// TARGET_OS_IPHONE covers any non-macOS Apple platform.
|
||||||
#elif defined(__APPLE__) && TARGET_OS_IPHONE
|
// It won't be defined on older macOS SDKs
|
||||||
|
#elif defined(__APPLE__) && defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
|
||||||
# define MAX_MARSHAL_STACK_DEPTH 1500
|
# define MAX_MARSHAL_STACK_DEPTH 1500
|
||||||
#else
|
#else
|
||||||
# define MAX_MARSHAL_STACK_DEPTH 2000
|
# define MAX_MARSHAL_STACK_DEPTH 2000
|
||||||
|
|
Loading…
Reference in New Issue