From d8a3f1404382b338571624794254c606d0ef3e99 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Mon, 4 Jun 2018 22:12:57 +0200 Subject: added local win32 fork of json-c here --- src/3rdParty/json-c/math_compat.h | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/3rdParty/json-c/math_compat.h (limited to 'src/3rdParty/json-c/math_compat.h') diff --git a/src/3rdParty/json-c/math_compat.h b/src/3rdParty/json-c/math_compat.h new file mode 100644 index 0000000..751c659 --- /dev/null +++ b/src/3rdParty/json-c/math_compat.h @@ -0,0 +1,41 @@ +#ifndef __math_compat_h +#define __math_compat_h + +/* Define isnan and isinf on Windows/MSVC */ + +#ifndef HAVE_DECL_ISNAN +# ifdef HAVE_DECL__ISNAN +#include +#define isnan(x) _isnan(x) +# endif +#endif + +#ifndef HAVE_DECL_ISINF +# ifdef HAVE_DECL__FINITE +#include +#define isinf(x) (!_finite(x)) +# endif +#endif + +#ifdef WIN32 +#ifndef NAN +const unsigned long __json_nan[2] = {0xffffffff, 0x7fffffff}; +#define NAN (*(const double*) __json_nan) +#endif +#else +#ifndef HAVE_DECL_NAN +#error This platform does not have nan() +#endif +#endif + +#ifdef WIN32 +#include +#ifndef INFINITY +#define INFINITY DBL_MAX +#endif +#else +#ifndef HAVE_DECL_INFINITY +#error This platform does not have INFINITY +#endif +#endif +#endif -- cgit v1.2.3-54-g00ecf