ngspice.h, cm.h, cleanup NAN defines
This commit is contained in:
parent
8480898399
commit
5299f8cdb6
|
|
@ -45,18 +45,16 @@ NON-STANDARD FEATURES
|
|||
#include "ngspice/cmproto.h"
|
||||
#include "ngspice/mifcmdat.h"
|
||||
|
||||
#if defined (_MSC_VER)
|
||||
#ifndef NAN
|
||||
#if !defined(NAN)
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1800)
|
||||
/* VS 2012 or less cannot evaluate 0.0/0.0 */
|
||||
static const __int64 global_nan = 0x7ff8000000000000i64;
|
||||
#define NAN (*(const double *) &global_nan)
|
||||
#else
|
||||
#define NAN (0.0/0.0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(NAN)
|
||||
#define NAN (0.0/0.0)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* type safe variants of the <ctype.h> functions for char arguments
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -195,11 +195,6 @@ extern double x_atanh(double);
|
|||
#define inline __inline
|
||||
#define popen _popen
|
||||
#define pclose _pclose
|
||||
/* NAN not available in MS VS 2008 */
|
||||
#ifndef NAN
|
||||
static const __int64 global_nan = 0x7ff8000000000000i64;
|
||||
#define NAN (*(const double *) &global_nan)
|
||||
#endif
|
||||
|
||||
// undo a #define bool _Bool in MS Visual Studio 2015
|
||||
#if defined(bool)
|
||||
|
|
@ -210,9 +205,14 @@ extern double x_atanh(double);
|
|||
#pragma warning(disable: 4127)
|
||||
#endif
|
||||
|
||||
// for non C99 environments
|
||||
#if !defined(NAN)
|
||||
#define NAN (0.0/0.0)
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1800)
|
||||
/* VS 2012 or less cannot evaluate 0.0/0.0 */
|
||||
static const __int64 global_nan = 0x7ff8000000000000i64;
|
||||
#define NAN (*(const double *) &global_nan)
|
||||
#else
|
||||
#define NAN (0.0/0.0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
|
|
|
|||
Loading…
Reference in New Issue