8000 gh-61103: drop unused Py_HAVE_C_COMPLEX define · python/cpython@782e2b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 782e2b4

Browse files
committed
gh-61103: drop unused Py_HAVE_C_COMPLEX define
The Py_FFI_SUPPORT_C_COMPLEX check configure check imply support for complex types.
1 parent 8d0e07e commit 782e2b4

File tree

3 files changed

+2
-78
lines changed

3 files changed

+2
-78
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_HAVE_C_COMPLEX) && 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.h
2929
#endif
@@ -457,7 +457,7 @@ EXPORT(double) my_sqrt(double a)
457457
return sqrt(a);
458458
}
459459

460-
#if defined(Py_HAVE_C_COMPLEX) && 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);

configure

Lines changed: 0 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3838,35 +3838,6 @@ dnl The AIX_BUILDDATE is obtained from the kernel fileset - bos.mp64
38383838
*) ;;
38393839
esac
38403840

3841-
# check for _Complex C type
3842-
#
3843-
# Note that despite most compilers define __STDC_IEC_559_COMPLEX__ - almost
3844-
# none properly support C11+ Annex G (where pure imaginary types
3845-
# represented by _Imaginary are mandatory). This is a bug (see e.g.
3846-
# llvm/llvm-project#60269), so we don't rely on presence
3847-
# of __STDC_IEC_559_COMPLEX__.
3848-
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3849-
#include <complex.h>
3850-
#define test(type, out) \
3851-
{ \
3852-
type complex z = 1 + 2*I; z = z*z; \
3853-
(out) = (out) || creal(z) != -3 || cimag(z) != 4; \
3854-
}
3855-
int main(void)
3856-
{
3857-
int res = 0;
3858-
test(float, res);
3859-
test(double, res);
3860-
test(long double, res);
3861-
return res;
3862-
}]])], [ac_cv_c_complex_supported=yes],
3863-
[ac_cv_c_complex_supported=no],
3864-
[ac_cv_c_complex_supported=no])
3865-
if test "$ac_cv_c_complex_supported" = "yes"; then
3866-
AC_DEFINE([Py_HAVE_C_COMPLEX], [1],
3867-
[Defined if _Complex C type is available.])
3868-
fi
3869-
38703841
# check for systems that require aligned memory access
38713842
AC_CACHE_CHECK([aligned memory access is required], [ac_cv_aligned_required],
38723843
[AC_RUN_IFELSE([AC_LANG_SOURCE([[

0 commit comments

Comments
 (0)
0