libCom: Use OS NAN and INFINITY macros where available.

bug: 545385
This commit is contained in:
Andrew Johnson
2010-09-23 14:18:03 -05:00
parent a9b5f0c6a0
commit eacb6602bc

View File

@@ -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