libCom: Use OS NAN and INFINITY macros where available.
bug: 545385
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user