From eaaea901e061c7dba6b76dfb5bf51aad9f7643ee Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 29 Sep 2010 17:42:10 -0500 Subject: [PATCH] libCom: fix epicsNAN generation on vxWorks. --- src/libCom/osi/os/vxWorks/epicsMath.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libCom/osi/os/vxWorks/epicsMath.h b/src/libCom/osi/os/vxWorks/epicsMath.h index 63f9af618..e973d2d9c 100644 --- a/src/libCom/osi/os/vxWorks/epicsMath.h +++ b/src/libCom/osi/os/vxWorks/epicsMath.h @@ -14,9 +14,16 @@ #include #include -#define isnan(D) isNan(D) +/* private/mathP.h defines NAN as 4, and uses its value in the + * isNan() macro. We need mathP.h for isInf(), but can create + * our own isnan() test. epicsMath.cpp requires that NAN either + * be undef or yield the NaN value, so this solves the issue. + */ +#undef NAN + +#define isnan(D) (!(D == D)) #define isinf(D) isInf(D) -#define finite(D) (!isNan(D) && !isInf(D)) +#define finite(D) (!isnan(D) && !isInf(D)) #ifdef __cplusplus extern "C" {