10000 gh-61103: support double complex (_Complex) type in ctypes by skirpichev · Pull Request #120894 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-61103: support double complex (_Complex) type in ctypes #120894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 57 commits into from
Jul 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c9b872f
gh-61103: support double complex (_Complex) type in ctypes
skirpichev Jun 22, 2024
b402300
+ ifdef
skirpichev Jun 23, 2024
ad39e6d
+ fix rst formatting
skirpichev Jun 23, 2024
fd9135b
+ CMPLX
skirpichev Jun 23, 2024
c296fb3
Apply suggestions from code review
skirpichev Jun 23, 2024
7453ca5
+ support _Complex in c-analyzer
skirpichev Jun 23, 2024
e444c9c
+1
skirpichev Jun 23, 2024
2e90643
expand docs
skirpichev Jun 23, 2024
32ffacf
drop ctypes.__STDC_IEC_559_COMPLEX__
skirpichev Jun 23, 2024
9163950
And more tests, finally)
skirpichev Jun 23, 2024
bf81682
Apply suggestions from code review
skirpichev Jun 23, 2024
af2fdce
Apply suggestions from code review
skirpichev Jun 23, 2024
6d9d5ab
+ allow _Complex specifier before float/double/etc
skirpichev Jun 23, 2024
f9c709c
+ comment on clang workaround
skirpichev Jun 23, 2024
ccd418d
Address review:
skirpichev Jun 24, 2024
eb313dc
+ @requires_IEEE_754 for test_csqrt()
skirpichev Jun 24, 2024
693c04e
Revert "+ @requires_IEEE_754 for test_csqrt()"
skirpichev Jun 24, 2024
0ee7049
Adjust test_csqrt() to not use special numbers
skirpichev Jun 24, 2024
de91bbe
Revert "Adjust test_csqrt() to not use special numbers"
skirpichev Jun 24, 2024
b79200e
+1
skirpichev Jun 24, 2024
be6a685
+1
skirpichev Jun 24, 2024
04e89c2
revert test + fix typo
skirpichev Jun 24, 2024
0bc87da
Adjust test_csqrt() to not use special numbers
skirpichev Jun 24, 2024
6347412
+ make CMPLX static
skirpichev Jun 24, 2024
e757fb6
try bad CMPLX()
skirpichev Jun 24, 2024
1eb989c
more tests
skirpichev Jun 24, 2024
b44aae2
cexp test
skirpichev Jun 24, 2024
2153608
use my_csquare() in test
skirpichev Jun 24, 2024
af42aa8
revert CMPLX
skirpichev Jun 24, 2024
e57198e
Address review:
skirpichev Jun 24, 2024
36732bc
revert tests
skirpichev Jun 24, 2024
892b241
XXX skip test on MacOs arm64
skirpichev Jun 24, 2024
ee953c3
Revert "XXX skip test on MacOs arm64"
skirpichev Jun 24, 2024
875cbb8
XXX (to pass)
skirpichev Jun 24, 2024
f8e3a47
Address review: guard _complex.h with ifndef
skirpichev Jun 24, 2024
f447919
Apply suggestions from code review
skirpichev Jun 24, 2024
7b1c366
Merge branch 'master' into ctypes-c_complex-61103
skirpichev Jun 25, 2024
2ea028a
Add _Complex (sic!) to union result
skirpichev Jun 25, 2024
837add4
add missing ifdef + restore tests
skirpichev Jun 25, 2024
1b8f37e
Adjust test_csqrt() to not use special numbers
skirpichev Jun 24, 2024
0bd1ebe
Add _Complex also to tagPyCArgObject struct
skirpichev Jun 25, 2024
6eba445
cleanup: use "complex" instead of _Complex
skirpichev Jun 25, 2024
a6ac463
address review:
skirpichev Jun 26, 2024
615e8de
Update Modules/_ctypes/_ctypes.c
skirpichev Jun 26, 2024
f7d9973
address review: renamed macro (->PY_HAVE_C_COMPLEX)
skirpichev Jun 26, 2024
3d170bd
+ autoreconf
skirpichev Jun 26, 2024
4dd044c
+ test to ensure CMPLX preserves special components
skirpichev Jun 26, 2024
4cf7045
address review: rename macros to Py_HAVE_C_COMPLEX
skirpichev Jun 28, 2024
264fa7d
fix typos and adjust Makefile.pre.in
skirpichev Jun 28, 2024
f54b964
enable Py_HAVE_C_COMPLEX only if libff support complex numbers
skirpichev Jun 29, 2024
23db200
Revert "enable Py_HAVE_C_COMPLEX only if libff support complex numbers"
skirpichev Jun 29, 2024
5a7e366
ifdef Py_HAVE_C_COMPLEX -> if defined(Py_HAVE_C_COMPLEX) && defined(F…
skirpichev Jun 29, 2024
388e2ca
+ missing ffi.h imports
skirpichev Jun 29, 2024
e888565
+ add libffi's cflags/ldflags to _ctypes_test.c deps
skirpichev Jun 29, 2024
56b524c
Merge branch 'master' into ctypes-c_complex-61103
skirpichev Jun 29, 2024
e9cab4a
Adjust test in _ctypes.c to not use FFI_TYPE_COMPLEX define
skirpichev Jun 29, 2024
6d5bf66
sed: FFI_TYPE_COMPLEX -> FFI_TARGET_HAS_COMPLEX_TYPE
skirpichev Jun 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
+1
  • Loading branch information
skirpichev committed Jun 24, 2024
commit be6a685469a36a7e77ea9e1524aa99c43d1b3380
2 changes: 1 addition & 1 deletion Lib/test/test_ctypes/test_libc.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_sqrt(self):
def test_csqrt(self):
lib.my_csqrt.argtypes = ctypes.c_double_complex,
lib.my_csqrt.restype = ctypes.c_double_complex
self.assertEqual(lib.my_csqrt(4.0), 2+0j)
self.assertAlmostEqual(lib.my_csqrt(4.0), 2+0j)
self.assertAlmostEqual(lib.my_csqrt(1+1j),
1.09868411346781+0.45508986056222733j)
self.assertAlmostEqual(lib.my_csqrt(1-1j),
Expand Down
Loading
0