From df846346a11c808a0c4e0e8557e7d709d31d6a7f Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 18 Oct 2015 22:01:32 +0200 Subject: [PATCH] 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 ) --- src/include/ngspice/ngspice.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/ngspice/ngspice.h b/src/include/ngspice/ngspice.h index d2c602eaf..3df2b6f64 100644 --- a/src/include/ngspice/ngspice.h +++ b/src/include/ngspice/ngspice.h @@ -177,7 +177,9 @@ extern double x_atanh(double); #define fileno _fileno #define getcwd _getcwd #define chdir _chdir +#if (_MSC_VER < 1800) #define isnan _isnan +#endif #define finite _finite #define scalb _scalb #define logb _logb @@ -196,6 +198,12 @@ extern double x_atanh(double); 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) +#undef bool +#endif + // warning C4127: Bedingter Ausdruck ist konstant #pragma warning(disable: 4127) #endif