]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-125206: Make _Py_FFI_SUPPORT_C_COMPLEX private (GH-135932) (GH-135973)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 26 Jun 2025 10:13:47 +0000 (12:13 +0200)
committerGitHub <noreply@github.com>
Thu, 26 Jun 2025 10:13:47 +0000 (10:13 +0000)
(cherry picked from commit 9193efdeab4596f987528ba278afa2eca93a9e8a)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Modules/_ctypes/_ctypes_test.c
Modules/_ctypes/cfield.c
Modules/_ctypes/ctypes.h
configure
configure.ac
pyconfig.h.in

index d28e5708b4493306133c5b0dac402f1cdac95461..66338805007853b679d89a81211f9a00b6516058 100644 (file)
@@ -23,7 +23,7 @@
 #  define _Py_thread_local __thread
 #endif
 
-#if defined(Py_FFI_SUPPORT_C_COMPLEX)
+#if defined(_Py_FFI_SUPPORT_C_COMPLEX)
 #  include <complex.h>            // csqrt()
 #  undef I                        // for _ctypes_test_generated.c.h
 #endif
@@ -457,7 +457,7 @@ EXPORT(double) my_sqrt(double a)
     return sqrt(a);
 }
 
-#if defined(Py_FFI_SUPPORT_C_COMPLEX)
+#if defined(_Py_FFI_SUPPORT_C_COMPLEX)
 EXPORT(double complex) my_csqrt(double complex a)
 {
     return csqrt(a);
index 86bcc805360a3fd66b8b515a6eb69c1391f28238..662b57a5b825e20d5873c0b58c0dcfd9fe30dfd9 100644 (file)
@@ -759,7 +759,7 @@ d_get(void *ptr, Py_ssize_t size)
     return PyFloat_FromDouble(val);
 }
 
-#if defined(Py_FFI_SUPPORT_C_COMPLEX)
+#if defined(_Py_FFI_SUPPORT_C_COMPLEX)
 
 /* We don't use _Complex types here, using arrays instead, as the C11+
    standard says: "Each complex type has the same representation and alignment
@@ -1599,7 +1599,7 @@ for base_code, base_c_type in [
     ///////////////////////////////////////////////////////////////////////////
 
     TABLE_ENTRY_SW(d, &ffi_type_double);
-#if defined(Py_FFI_SUPPORT_C_COMPLEX)
+#if defined(_Py_FFI_SUPPORT_C_COMPLEX)
     if (Py_FFI_COMPLEX_AVAILABLE) {
         TABLE_ENTRY(D, &ffi_type_complex_double);
         TABLE_ENTRY(F, &ffi_type_complex_float);
index 2d859ed63e1758df60483de3f88546adb9b4f073..03fde30c2e0944fdda67c2fc173cbadaf3839dd8 100644 (file)
@@ -11,7 +11,7 @@
 
 // Do we support C99 complex types in ffi?
 // For Apple's libffi, this must be determined at runtime (see gh-128156).
-#if defined(Py_FFI_SUPPORT_C_COMPLEX)
+#if defined(_Py_FFI_SUPPORT_C_COMPLEX)
 #   if USING_APPLE_OS_LIBFFI && defined(__has_builtin)
 #       if __has_builtin(__builtin_available)
 #           define Py_FFI_COMPLEX_AVAILABLE __builtin_available(macOS 10.15, *)
index 827df044daf955d51398c5456e6625a4ec87a2d9..47b6c0ebc88a01f09b1c4343690f6464be21bf80 100755 (executable)
--- a/configure
+++ b/configure
@@ -15742,7 +15742,7 @@ fi
 printf "%s\n" "$ac_cv_ffi_complex_double_supported" >&6; }
 if test "$ac_cv_ffi_complex_double_supported" = "yes"; then
 
-printf "%s\n" "#define Py_FFI_SUPPORT_C_COMPLEX 1" >>confdefs.h
+printf "%s\n" "#define _Py_FFI_SUPPORT_C_COMPLEX 1" >>confdefs.h
 
 fi
 
index a57205ede02ef07a7f4f46160a7192f1c969df7d..a4a747180bfdd17f75a9cb9dbfd3d5b00ded4eed 100644 (file)
@@ -4163,7 +4163,7 @@ int main(void)
 [ac_cv_ffi_complex_double_supported=no])
 ])])
 if test "$ac_cv_ffi_complex_double_supported" = "yes"; then
-    AC_DEFINE([Py_FFI_SUPPORT_C_COMPLEX], [1],
+    AC_DEFINE([_Py_FFI_SUPPORT_C_COMPLEX], [1],
               [Defined if _Complex C type can be used with libffi.])
 fi
 
index 65a2c55217c258b594084cf2c28ff4b66d7cafb1..d4f1da7fb107763581fd4883477e9069ecf0e096 100644 (file)
 /* Defined if Python is built as a shared library. */
 #undef Py_ENABLE_SHARED
 
-/* Defined if _Complex C type can be used with libffi. */
-#undef Py_FFI_SUPPORT_C_COMPLEX
-
 /* Define if you want to disable the GIL */
 #undef Py_GIL_DISABLED
 
 /* Maximum length in bytes of a thread name */
 #undef _PYTHREAD_NAME_MAXLEN
 
+/* Defined if _Complex C type can be used with libffi. */
+#undef _Py_FFI_SUPPORT_C_COMPLEX
+
 /* Define to force use of thread-safe errno, h_errno, and other functions */
 #undef _REENTRANT