summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2024-03-28 07:59:33 (GMT)
committerGitHub <noreply@github.com>2024-03-28 07:59:33 (GMT)
commitf006338017cfbf846e8f7391b9ee5f69df8dc620 (patch)
tree6db12f901d882f53401dc2d3fafbe101c2b8fdbc /Python/marshal.c
parentb44898299a2ed97045c270f6474785da2ff07ced (diff)
downloadcpython-f006338017cfbf846e8f7391b9ee5f69df8dc620.zip
cpython-f006338017cfbf846e8f7391b9ee5f69df8dc620.tar.gz
cpython-f006338017cfbf846e8f7391b9ee5f69df8dc620.tar.bz2
gh-114099: Additions to standard library to support iOS (GH-117052)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Malcolm Smith <smith@chaquo.com> Co-authored-by: Ned Deily <nad@python.org>
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index daec741..21d242b 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -14,6 +14,10 @@
#include "pycore_setobject.h" // _PySet_NextEntry()
#include "marshal.h" // Py_MARSHAL_VERSION
+#ifdef __APPLE__
+# include "TargetConditionals.h"
+#endif /* __APPLE__ */
+
/*[clinic input]
module marshal
[clinic start generated code]*/
@@ -33,11 +37,14 @@ module marshal
* #if defined(MS_WINDOWS) && defined(_DEBUG)
*/
#if defined(MS_WINDOWS)
-#define MAX_MARSHAL_STACK_DEPTH 1000
+# define MAX_MARSHAL_STACK_DEPTH 1000
#elif defined(__wasi__)
-#define MAX_MARSHAL_STACK_DEPTH 1500
+# define MAX_MARSHAL_STACK_DEPTH 1500
+// TARGET_OS_IPHONE covers any non-macOS Apple platform.
+#elif defined(__APPLE__) && TARGET_OS_IPHONE
+# define MAX_MARSHAL_STACK_DEPTH 1500
#else
-#define MAX_MARSHAL_STACK_DEPTH 2000
+# define MAX_MARSHAL_STACK_DEPTH 2000
#endif
#define TYPE_NULL '0'