From eacb6602bc1e9c203e7afd602ba45e563df1627a Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 23 Sep 2010 14:18:03 -0500 Subject: [PATCH] libCom: Use OS NAN and INFINITY macros where available. bug: 545385 --- src/libCom/osi/epicsMath.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libCom/osi/epicsMath.cpp b/src/libCom/osi/epicsMath.cpp index 6e53e62a0..1388e658a 100644 --- a/src/libCom/osi/epicsMath.cpp +++ b/src/libCom/osi/epicsMath.cpp @@ -1,5 +1,5 @@ /*************************************************************************\ -* Copyright (c) 2009 UChicago Argonna LLC, as Operator of Argonne +* Copyright (c) 2010 UChicago Argonna LLC, as Operator of Argonne * National Laboratory. * EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. @@ -14,21 +14,27 @@ #pragma warning(disable:4723) #endif +#ifndef NAN static float makeNAN ( void ) { float a = 0, b = 0; return a / b; } +#define NAN makeNAN() +#endif +#ifndef INFINITY static float makeINF ( void ) { float a = 1, b = 0; return a / b; } +#define INFINITY makeINF() +#endif extern "C" { -epicsShareDef float epicsNAN = makeNAN(); -epicsShareDef float epicsINF = makeINF(); +epicsShareDef float epicsNAN = NAN; +epicsShareDef float epicsINF = INFINITY; } #ifdef _MSC_VER