Skip to content
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

Add fenceposting for HAVE_DECL_ISINF and HAVE_DECL_ISNAN #2559

Merged
merged 2 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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