File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1092,6 +1092,17 @@ d_get(void *ptr, Py_ssize_t size)
1092
1092
}
1093
1093
1094
1094
#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
+ */
1095
1106
#if defined(__clang__ ) && __has_builtin (__builtin_complex ) && \
1096
1107
!defined(CMPLX )
1097
1108
# define CMPLX (x , y ) __builtin_complex ((double) (x), (double) (y))
You can’t perform that action at this time.
0 commit comments