Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 013765e

Browse filesBrowse files
committed
+ comment on clang workaround
1 parent 6d9d5ab commit 013765e
Copy full SHA for 013765e

File tree

Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed

‎Modules/_ctypes/cfield.c

Copy file name to clipboardExpand all lines: Modules/_ctypes/cfield.c
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,17 @@ d_get(void *ptr, Py_ssize_t size)
10921092
}
10931093

10941094
#ifdef __STDC_IEC_559_COMPLEX__
1095+
/* Other compilers (than clang), that claims to
1096+
implement C11 *and* define __STDC_IEC_559_COMPLEX__ don't have
1097+
issue with CMPLX(). This is specific to glibc & clang combination:
1098+
https://sourceware.org/bugzilla/show_bug.cgi?id=26287
1099+
1100+
Here we fallback to using __builtin_complex(), available in clang
1101+
v12+. Unfortunatelly, it's impossible to emulate CMPLX(), using
1102+
only complex arithmetic, if implemented only mixed-mode rules
1103+
for "complex op real" cases (as most compilers do):
1104+
think about CMPLX(1, NAN).
1105+
*/
10951106
#if defined(__clang__) && __has_builtin(__builtin_complex) && \
10961107
!defined(CMPLX)
10971108
# define CMPLX(x, y) __builtin_complex ((double) (x), (double) (y))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.