Skip to content

Commit

Permalink
Merge pull request #2559 from WardF/gh2132.wif
Browse files Browse the repository at this point in the history
Add fenceposting for HAVE_DECL_ISINF and HAVE_DECL_ISNAN
  • Loading branch information
WardF committed Nov 16, 2022
2 parents c99f4f9 + 4d63f03 commit 0fc2c81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
9 changes: 8 additions & 1 deletion libdispatch/dutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
{
Expand All @@ -417,6 +422,8 @@ int isnan(double x)
( (unsigned)ieee754.u != 0 ) > 0x7ff00000;
}

#endif /* HAVE_DECL_ISNAN */

#endif /*APPLE*/
#endif /*!_INTEL_COMPILER*/

Expand Down

0 comments on commit 0fc2c81

Please sign in to comment.