]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-131591: Handle includes for iOS in remote_debugging.c (#132050)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Sun, 6 Apr 2025 20:39:25 +0000 (21:39 +0100)
committerGitHub <noreply@github.com>
Sun, 6 Apr 2025 20:39:25 +0000 (21:39 +0100)
Include/internal/pycore_ceval.h
Python/remote_debugging.c

index c44f3a283e8fb66b5b63dac4c1b0fde2db59b3e0..18c8bc0624fea772aea42e015d02b9ab5fd9c994 100644 (file)
@@ -351,6 +351,7 @@ PyAPI_FUNC(_PyStackRef) _PyFloat_FromDouble_ConsumeInputs(_PyStackRef left, _PyS
 
 #ifndef Py_SUPPORTS_REMOTE_DEBUG
     #if defined(__APPLE__)
+    #include <TargetConditionals.h>
     #  if !defined(TARGET_OS_OSX)
 // Older macOS SDKs do not define TARGET_OS_OSX
     #     define TARGET_OS_OSX 1
index 9b2297b5627aa319e21b45218465ceeca76f3b08..1b7311f0ce897b1c99b2cdaefe5ff58b1e907278 100644 (file)
 #    include <sys/mman.h>
 #endif
 
-#if defined(__APPLE__)
-#  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
-#    include <libproc.h>
-#    include <mach-o/fat.h>
-#    include <mach-o/loader.h>
-#    include <mach-o/nlist.h>
-#    include <mach/mach.h>
-#    include <mach/mach_vm.h>
-#    include <mach/machine.h>
-#    include <sys/mman.h>
-#    include <sys/proc.h>
-#    include <sys/sysctl.h>
-#  endif
+#if defined(__APPLE__) && TARGET_OS_OSX
+#  include <libproc.h>
+#  include <mach-o/fat.h>
+#  include <mach-o/loader.h>
+#  include <mach-o/nlist.h>
+#  include <mach/mach.h>
+#  include <mach/mach_vm.h>
+#  include <mach/machine.h>
+#  include <sys/mman.h>
+#  include <sys/proc.h>
+#  include <sys/sysctl.h>
 #endif
 
 #ifdef MS_WINDOWS
@@ -65,6 +58,8 @@
 #    define HAVE_PROCESS_VM_READV 0
 #endif
 
+#if defined(Py_REMOTE_DEBUG) && defined(Py_SUPPORTS_REMOTE_DEBUG)
+
 // Define a platform-independent process handle structure
 typedef struct {
     pid_t pid;
@@ -101,8 +96,6 @@ cleanup_proc_handle(proc_handle_t *handle) {
     handle->pid = 0;
 }
 
-#if defined(Py_REMOTE_DEBUG) && defined(Py_SUPPORTS_REMOTE_DEBUG)
-
 #if defined(__APPLE__) && TARGET_OS_OSX
 static uintptr_t
 return_section_address(