Skip to content

Commit

Permalink
gh-125206: Correct detection of complex numbers support in libffi (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev authored Oct 30, 2024
1 parent 35df4eb commit dcad8fe
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correct detection of complex numbers support in libffi.
19 changes: 16 additions & 3 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4090,8 +4090,10 @@ AS_VAR_IF([have_libffi], [yes], [
# See https://github.com/python/cpython/issues/125206 for more details.
#
AC_CACHE_CHECK([libffi has complex type support], [ac_cv_ffi_complex_double_supported],
[ac_save_cc="$CC"
CC="$CC -lffi"
[WITH_SAVE_ENV([
CPPFLAGS="$LIBFFI_CFLAGS $CPPFLAGS"
LDFLAGS="$LIBFFI_LIBS $LDFLAGS"
LIBS="$LIBFFI_LIBS $LIBS"
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <complex.h>
#include <ffi.h>
Expand All @@ -4118,7 +4120,7 @@ int main(void)
]])], [ac_cv_ffi_complex_double_supported=yes],
[ac_cv_ffi_complex_double_supported=no],
[ac_cv_ffi_complex_double_supported=no])
CC="$ac_save_cc"])
])])
if test "$ac_cv_ffi_complex_double_supported" = "yes"; then
AC_DEFINE([Py_FFI_SUPPORT_C_COMPLEX], [1],
[Defined if _Complex C type can be used with libffi.])
Expand Down

0 comments on commit dcad8fe

Please sign in to comment.