-
-
Notifications
You must be signed in to change notification settings - Fork 319
Rewrite complex number configuration logic to fix re-configuration issue and improve clarity #6080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Rewrite complex number configuration logic to fix re-configuration issue and improve clarity #6080
Conversation
|
|
||
| # Check if __STDC_NO_COMPLEX__ macro is defined, in which case complex number | ||
| # support is not available | ||
| HDF_FUNCTION_TEST (HAVE_STDC_NO_COMPLEX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this check to be first, as it is a standalone check that can tell us early if complex number support isn't available
| CHECK_INCLUDE_FILE (complex.h ${HDF_PREFIX}_HAVE_COMPLEX_H) | ||
| if (${HDF_PREFIX}_HAVE_COMPLEX_H) | ||
| # Check for C99 complex number types first | ||
| HDF_CHECK_TYPE_SIZE ("float _Complex" ${HDF_PREFIX}_SIZEOF_C99_FLOAT_COMPLEX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the variable names for these size checks so they aren't mixed with the final names used by the macros in H5pubconf.h
| cmake_pop_check_state () | ||
| if (${HDF_PREFIX}_SIZEOF__FCOMPLEX AND ${HDF_PREFIX}_SIZEOF__DCOMPLEX AND | ||
| ${HDF_PREFIX}_SIZEOF__FCOMPLEX) | ||
| set (${HDF_PREFIX}_SIZEOF_FLOAT_COMPLEX ${${HDF_PREFIX}_SIZEOF__FCOMPLEX} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved setting the final size macro variables to as late as possible and updated the check below to avoid issues with mixing up when a particular type of complex numbers are available
fd495c8 to
9dfe4ec
Compare
…sue and improve clarity
9dfe4ec to
984bfda
Compare
brtnfld
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice solution
Important
Rewrites complex number configuration logic in
ConfigureChecks.cmaketo improve clarity and fix re-configuration issues by restructuring checks for C99 and MSVC complex types.ConfigureChecks.cmaketo first check__STDC_NO_COMPLEX__macro.complex.hand C99 complex types (float _Complex,double _Complex,long double _Complex)._Fcomplex,_Dcomplex,_Lcomplex) if C99 types are unavailable.H5_HAVE_C99_COMPLEX_NUMBERSif C99 types are available.This description was created by
for 984bfda. You can customize this summary. It will automatically update as commits are pushed.