8000 gh-125206: Make _Py_FFI_SUPPORT_C_COMPLEX private (GH-135932) · python/cpython@9193efd · GitHub
[go: up one dir, main page]

Skip to content

Commit 9193efd

Browse files
authored
gh-125206: Make _Py_FFI_SUPPORT_C_COMPLEX private (GH-135932)
1 parent 10a3d43 commit 9193efd

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Modules/_ctypes/_ctypes_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# define _Py_thread_local __thread
2424
#endif
2525

26-
#if defined(Py_FFI_SUPPORT_C_COMPLEX)
26+
#if defined(_Py_FFI_SUPPORT_C_COMPLEX)
2727
# include <complex.h> // csqrt()
2828
# undef I // for _ctypes_test_generated.c 10000 .h
2929
#endif
@@ -457,7 +457,7 @@ EXPORT(double) my_sqrt(double a)
457457
return sqrt(a);
458458
}
459459

460-
#if defined(Py_FFI_SUPPORT_C_COMPLEX)
460+
#if defined(_Py_FFI_SUPPORT_C_COMPLEX)
461461
EXPORT(double complex) my_csqrt(double complex a)
462462
{
463463
return csqrt(a);

Modules/_ctypes/cfield.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ d_get(void *ptr, Py_ssize_t size)
759759
return PyFloat_FromDouble(val);
760760
}
761761

762-
#if defined(Py_FFI_SUPPORT_C_COMPLEX)
762+
#if defined(_Py_FFI_SUPPORT_C_COMPLEX)
763763

764764
/* We don't use _Complex types here, using arrays instead, as the C11+
765765
standard says: "Each complex type has the same representation and alignment
@@ -1599,7 +1599,7 @@ for base_code, base_c_type in [
15991599
///////////////////////////////////////////////////////////////////////////
16001600

16011601
TABLE_ENTRY_SW(d, &ffi_type_double);
1602-
#if defined(Py_FFI_SUPPORT_C_COMPLEX)
1602+
#if defined(_Py_FFI_SUPPORT_C_COMPLEX)
16031603
if (Py_FFI_COMPLEX_AVAILABLE) {
16041604
TABLE_ENTRY(D, &ffi_type_complex_double);
16051605
TABLE_ENTRY(F, &ffi_type_complex_float);

Modules/_ctypes/ctypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
// Do we support C99 complex types in ffi?
2525
// For Apple's libffi, this must be determined at runtime (see gh-128156).
26-
#if defined(Py_FFI_SUPPORT_C_COMPLEX)
26+
#if defined(_Py_FFI_SUPPORT_C_COMPLEX)
2727
# if USING_APPLE_OS_LIBFFI && defined(__has_builtin)
2828
# if __has_builtin(__builtin_available)
2929
# define Py_FFI_COMPLEX_AVAILABLE __builtin_available(macOS 10.15, *)

configure

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4163,7 +4163,7 @@ int main(void)
41634163
[ac_cv_ffi_complex_double_supported=no])
41644164
])])
41654165
if test "$ac_cv_ffi_complex_double_supported" = "yes"; then
4166-
AC_DEFINE([Py_FFI_SUPPORT_C_COMPLEX], [1],
4166+
AC_DEFINE([_Py_FFI_SUPPORT_C_COMPLEX], [1],
41674167
[Defined if _Complex C type can be used with libffi.])
41684168
fi
41694169

pyconfig.h.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,9 +1736,6 @@
17361736
/* Defined if Python is built as a shared library. */
17371737
#undef Py_ENABLE_SHARED
17381738

1739-
/* Defined if _Complex C type can be used with libffi. */
1740-
#undef Py_FFI_SUPPORT_C_COMPLEX
1741-
17421739
/* Define if you want to disable the GIL */
17431740
#undef Py_GIL_DISABLED
17441741

@@ -2026,6 +2023,9 @@
20262023
/* Maximum length in bytes of a thread name */
20272024
#undef _PYTHREAD_NAME_MAXLEN
20282025

2026+
/* Defined if _Complex C type can be used with libffi. */
2027+
#undef _Py_FFI_SUPPORT_C_COMPLEX
2028+
20292029
/* Define to force use of thread-safe errno, h_errno, and other functions */
20302030
#undef _REENTRANT
20312031

0 commit comments

Comments
 (0)
0