From ac7a080df8124f89152f56f85581320afa2a9641 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Wed, 16 Nov 2022 15:41:38 -0700 Subject: [PATCH 1/2] Add a check for HAVE_DECL_ISINF and HAVE_DECL_ISNAN in support of https://github.com/Unidata/netcdf-c/issues/2132 --- libdispatch/dutil.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libdispatch/dutil.c b/libdispatch/dutil.c index 171d010ef3..83b20dfb69 100644 --- a/libdispatch/dutil.c +++ b/libdispatch/dutil.c @@ -396,10 +396,12 @@ NC_testmode(NCURI* uri, const char* tag) return found; } -#if ! defined __INTEL_COMPILER +#if ! defined __INTEL_COMPILER #if defined __APPLE__ /** \internal */ +#if ! defined HAVE_DECL_ISINF + int isinf(double x) { union { unsigned long long u; double f; } ieee754; @@ -408,6 +410,9 @@ int isinf(double x) ( (unsigned)ieee754.u == 0 ); } +#endif /* HAVE_DECL_ISINF */ + +#if ! defined HAVE_DECL_ISNAN /** \internal */ int isnan(double x) { @@ -417,6 +422,8 @@ int isnan(double x) ( (unsigned)ieee754.u != 0 ) > 0x7ff00000; } +#endif /* HAVE_DECL_ISNAN */ + #endif /*APPLE*/ #endif /*!_INTEL_COMPILER*/ From 4d63f033641f426a3cbcc889b988f2142a2e92dd Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Wed, 16 Nov 2022 15:43:13 -0700 Subject: [PATCH 2/2] Fix mismatched arguments warning in CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce08071fa2..400a54dc22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1066,7 +1066,7 @@ IF(ENABLE_DAP) IF(NOT ENABLE_HDF5) SET(ENABLE_DAP4 OFF CACHE BOOL "") - ENDIF(ENABLE_HDF5) + ENDIF(NOT ENABLE_HDF5) ELSE() SET(ENABLE_DAP2 OFF CACHE BOOL "")