Skip to content

Commit 379aaa7

Browse files
committed
Fix(CMake): Resolve MSVC C99 complex check failure on re-configure
Prevent safety block skipping due to cached size variables. Fixes cache pollution issue.
1 parent aada8a8 commit 379aaa7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

config/ConfigureChecks.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,10 @@ if (${HDF_PREFIX}_HAVE_COMPLEX_H)
899899
HDF_CHECK_TYPE_SIZE ("double _Complex" ${HDF_PREFIX}_SIZEOF_DOUBLE_COMPLEX)
900900
HDF_CHECK_TYPE_SIZE ("long double _Complex" ${HDF_PREFIX}_SIZEOF_LONG_DOUBLE_COMPLEX)
901901

902-
if (MSVC AND NOT ${HDF_PREFIX}_SIZEOF_FLOAT_COMPLEX AND NOT ${HDF_PREFIX}_SIZEOF_DOUBLE_COMPLEX
903-
AND NOT ${HDF_PREFIX}_SIZEOF_LONG_DOUBLE_COMPLEX)
902+
if (MSVC AND
903+
((NOT ${HDF_PREFIX}_SIZEOF_FLOAT_COMPLEX) OR ${HDF_PREFIX}_SIZEOF__FCOMPLEX) AND
904+
((NOT ${HDF_PREFIX}_SIZEOF_DOUBLE_COMPLEX) OR ${HDF_PREFIX}_SIZEOF__DCOMPLEX) AND
905+
((NOT ${HDF_PREFIX}_SIZEOF_LONG_DOUBLE_COMPLEX) OR ${HDF_PREFIX}_SIZEOF__LCOMPLEX))
904906
# If using MSVC, the _Complex types (if available) are _Fcomplex, _Dcomplex and _Lcomplex.
905907
# The standard types are checked for first in case MSVC uses them in the future or in case
906908
# the compiler used is simulating MSVC and uses the standard types.

0 commit comments

Comments
 (0)