@@ -109,11 +109,19 @@ cdata.set('NPY_SIZEOF_PY_LONG_LONG',
109109if cc.has_header(' complex.h' )
110110 cdata.set10(' HAVE_COMPLEX_H' , true )
111111 cdata.set10(' NPY_USE_C99_COMPLEX' , true )
112- complex_types_to_check = [
113- [' NPY_HAVE_COMPLEX_FLOAT' , ' NPY_SIZEOF_COMPLEX_FLOAT' , ' complex float' , ' float' ],
114- [' NPY_HAVE_COMPLEX_DOUBLE' , ' NPY_SIZEOF_COMPLEX_DOUBLE' , ' complex double' , ' double' ],
115- [' NPY_HAVE_COMPLEX_LONG_DOUBLE' , ' NPY_SIZEOF_COMPLEX_LONGDOUBLE' , ' complex long double' , ' long double' ],
116- ]
112+ if cc.get_id() == ' msvc'
113+ complex_types_to_check = [
114+ [' NPY_HAVE_COMPLEX_FLOAT' , ' NPY_SIZEOF_COMPLEX_FLOAT' , ' _Fcomplex' , ' float' ],
115+ [' NPY_HAVE_COMPLEX_DOUBLE' , ' NPY_SIZEOF_COMPLEX_DOUBLE' , ' _Dcomplex' , ' double' ],
116+ [' NPY_HAVE_COMPLEX_LONG_DOUBLE' , ' NPY_SIZEOF_COMPLEX_LONGDOUBLE' , ' _Lcomplex' , ' long double' ],
117+ ]
118+ else
119+ complex_types_to_check = [
120+ [' NPY_HAVE_COMPLEX_FLOAT' , ' NPY_SIZEOF_COMPLEX_FLOAT' , ' complex float' , ' float' ],
121+ [' NPY_HAVE_COMPLEX_DOUBLE' , ' NPY_SIZEOF_COMPLEX_DOUBLE' , ' complex double' , ' double' ],
122+ [' NPY_HAVE_COMPLEX_LONG_DOUBLE' , ' NPY_SIZEOF_COMPLEX_LONGDOUBLE' , ' complex long double' , ' long double' ],
123+ ]
124+ endif
117125 foreach symbol_type : complex_types_to_check
118126 if cc.has_type(symbol_type[2 ], prefix : ' #include <complex.h>' )
119127 cdata.set10(symbol_type[0 ], true )
250258 # function is not available in CI. For the latter there is a fallback path,
251259 # but that is broken because we don't have the exact long double
252260 # representation checks.
253- cdata.set10(' HAVE_STRTOLD_L' , false )
261+ if cc.get_id() != ' msvc'
262+ cdata.set10(' HAVE_STRTOLD_L' , false )
263+ endif
254264endif
255265
256266# Other optional functions
@@ -451,7 +461,7 @@ if cc.get_id() == 'msvc'
451461 # libnpymath and libnpyrandom)
452462 if cc.has_argument(' -d2VolatileMetadata-' )
453463 staticlib_cflags += ' -d2VolatileMetadata-'
454- endif
464+ endif
455465endif
456466# TODO: change to "feature" option in meson_options.txt? See
457467# https://mesonbuild.com/Build-options.html#build-options
0 commit comments