Browse Source

visualc, cope with `bool' and `isnan()' in visual studio 2015

now they have isnan(),
  (presumably in math.h)

now they have a C99 `bool',
  (maybe even though not asked for with <stdbool.h>)
pre-master-46
h_vogt 11 years ago
committed by rlar
parent
commit
df846346a1
  1. 8
      src/include/ngspice/ngspice.h

8
src/include/ngspice/ngspice.h

@ -177,7 +177,9 @@ extern double x_atanh(double);
#define fileno _fileno #define fileno _fileno
#define getcwd _getcwd #define getcwd _getcwd
#define chdir _chdir #define chdir _chdir
#if (_MSC_VER < 1800)
#define isnan _isnan #define isnan _isnan
#endif
#define finite _finite #define finite _finite
#define scalb _scalb #define scalb _scalb
#define logb _logb #define logb _logb
@ -196,6 +198,12 @@ extern double x_atanh(double);
static const __int64 global_nan = 0x7ff8000000000000i64; static const __int64 global_nan = 0x7ff8000000000000i64;
#define NAN (*(const double *) &global_nan) #define NAN (*(const double *) &global_nan)
#endif #endif
// undo a #define bool _Bool in MS Visual Studio 2015
#if defined(bool)
#undef bool
#endif
// warning C4127: Bedingter Ausdruck ist konstant // warning C4127: Bedingter Ausdruck ist konstant
#pragma warning(disable: 4127) #pragma warning(disable: 4127)
#endif #endif

Loading…
Cancel
Save