Skip to content

Commit 3ec2116

Browse files
committed
gh-131591: Handle includes for iOS in remote_debugging.c
Signed-off-by: Pablo Galindo <[email protected]>
1 parent 943cc14 commit 3ec2116

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

Include/internal/pycore_ceval.h

+1
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ PyAPI_FUNC(_PyStackRef) _PyFloat_FromDouble_ConsumeInputs(_PyStackRef left, _PyS
349349

350350
#ifndef Py_SUPPORTS_REMOTE_DEBUG
351351
#if defined(__APPLE__)
352+
#include <TargetConditionals.h>
352353
# if !defined(TARGET_OS_OSX)
353354
// Older macOS SDKs do not define TARGET_OS_OSX
354355
# define TARGET_OS_OSX 1

Python/remote_debugging.c

+11-18
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,17 @@
2020
# include <sys/mman.h>
2121
#endif
2222

23-
#if defined(__APPLE__)
24-
# include <TargetConditionals.h>
25-
// Older macOS SDKs do not define TARGET_OS_OSX
26-
# if !defined(TARGET_OS_OSX)
27-
# define TARGET_OS_OSX 1
28-
# endif
29-
# if TARGET_OS_OSX
30-
# include <libproc.h>
31-
# include <mach-o/fat.h>
32-
# include <mach-o/loader.h>
33-
# include <mach-o/nlist.h>
34-
# include <mach/mach.h>
35-
# include <mach/mach_vm.h>
36-
# include <mach/machine.h>
37-
# include <sys/mman.h>
38-
# include <sys/proc.h>
39-
# include <sys/sysctl.h>
40-
# endif
23+
#if defined(__APPLE__) && TARGET_OS_OSX
24+
# include <libproc.h>
25+
# include <mach-o/fat.h>
26+
# include <mach-o/loader.h>
27+
# include <mach-o/nlist.h>
28+
# include <mach/mach.h>
29+
# include <mach/mach_vm.h>
30+
# include <mach/machine.h>
31+
# include <sys/mman.h>
32+
# include <sys/proc.h>
33+
# include <sys/sysctl.h>
4134
#endif
4235

4336
#ifdef MS_WINDOWS

0 commit comments

Comments
 (0)