Skip to content

Commit 0d630d1

Browse files
committed
fix: undefine __INTEL_LLVM_COMPILER for icx on Windows to restore _Dcomplex
1 parent 9445ecd commit 0d630d1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

meson.build

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ if cc.get_argument_syntax() == 'msvc'
5454
]
5555
link_args = ['/NXCompat', '/DynamicBase']
5656

57+
if cc.get_id() == 'intel-llvm-cl'
58+
# icx defines __INTEL_LLVM_COMPILER, which numpy >=2.4.4 excludes from
59+
# its _MSC_VER branch in npy_common.h, making npy_cdouble a native
60+
# C99 _Complex instead of _Dcomplex but Windows UCRT's complex.h
61+
# (creal/cimag/etc) is hard-typed to _Dcomplex regardless of compiler.
62+
# Undefine the macro so numpy's header picks _Dcomplex again.
63+
c_args += ['/U__INTEL_LLVM_COMPILER']
64+
endif
65+
5766
if cc.get_id().startswith('intel')
5867
c_args += [
5968
'/Qimf-precision=high', '/Qprotect-parens',

0 commit comments

Comments
 (0)