]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-100540: Remove unnecessary '-DMACOSX' for ctypes on macOS (GH-100542)
authorZachary Ware <zach@python.org>
Wed, 28 Dec 2022 18:06:58 +0000 (12:06 -0600)
committerGitHub <noreply@github.com>
Wed, 28 Dec 2022 18:06:58 +0000 (12:06 -0600)
The define was only used to protect a `#pragma clang diagnostic`
setting, which is already better guarded by `__clang__` anwyay.

Modules/_ctypes/callbacks.c
configure
configure.ac

index 459632b90907fd6ea77197778533d79af1509e2d..f6880889dc0f784e8ccc81d51032aa02d8fb1743 100644 (file)
@@ -426,7 +426,7 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
         PyErr_Format(PyExc_NotImplementedError, "ffi_prep_closure_loc() is missing");
         goto error;
 #else
-#if defined(__clang__) || defined(MACOSX)
+#if defined(__clang__)
         #pragma clang diagnostic push
         #pragma clang diagnostic ignored "-Wdeprecated-declarations"
 #endif
@@ -436,7 +436,7 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
 #endif
         result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
 
-#if defined(__clang__) || defined(MACOSX)
+#if defined(__clang__)
         #pragma clang diagnostic pop
 #endif
 #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
index 3f8daf9dad5fd8095ac0ff4f2f451112c9f073e4..72299939892dde0c4ff875b485e708b86d001ad0 100755 (executable)
--- a/configure
+++ b/configure
@@ -12846,7 +12846,7 @@ if test "x$have_libffi" = xyes; then :
   case $ac_sys_system in #(
   Darwin) :
 
-            as_fn_append LIBFFI_CFLAGS " -I\$(srcdir)/Modules/_ctypes/darwin -DMACOSX"
+            as_fn_append LIBFFI_CFLAGS " -I\$(srcdir)/Modules/_ctypes/darwin"
       ctypes_malloc_closure=yes
      ;; #(
   sunos5) :
index 734a4db83899151d5dc07553b1eabb0d1d7e65dc..d6499be4c007ecc137b5d2048f13f5224b8757b0 100644 (file)
@@ -3769,7 +3769,7 @@ AS_VAR_IF([have_libffi], [yes], [
   AS_CASE([$ac_sys_system],
     [Darwin], [
       dnl when do we need USING_APPLE_OS_LIBFFI?
-      AS_VAR_APPEND([LIBFFI_CFLAGS], [" -I\$(srcdir)/Modules/_ctypes/darwin -DMACOSX"])
+      AS_VAR_APPEND([LIBFFI_CFLAGS], [" -I\$(srcdir)/Modules/_ctypes/darwin"])
       ctypes_malloc_closure=yes
     ],
     [sunos5], [AS_VAR_APPEND([LIBFFI_LIBS], [" -mimpure-text"])]