2014-03-02 12:16:37 -05:00
|
|
|
#ifndef __math_compat_h
|
|
|
|
|
#define __math_compat_h
|
|
|
|
|
|
2017-12-06 00:20:59 -05:00
|
|
|
/**
|
|
|
|
|
* @file
|
|
|
|
|
* @brief Do not use, json-c internal, may be changed or removed at any time.
|
|
|
|
|
*/
|
|
|
|
|
|
2015-02-05 15:56:49 +00:00
|
|
|
/* Define isnan, isinf, infinity and nan on Windows/MSVC */
|
2014-03-02 12:16:37 -05:00
|
|
|
|
|
|
|
|
#ifndef HAVE_DECL_ISNAN
|
|
|
|
|
# ifdef HAVE_DECL__ISNAN
|
|
|
|
|
#include <float.h>
|
|
|
|
|
#define isnan(x) _isnan(x)
|
|
|
|
|
# endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef HAVE_DECL_ISINF
|
|
|
|
|
# ifdef HAVE_DECL__FINITE
|
|
|
|
|
#include <float.h>
|
|
|
|
|
#define isinf(x) (!_finite(x))
|
|
|
|
|
# endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-02-05 15:56:49 +00:00
|
|
|
#ifndef HAVE_DECL_INFINITY
|
|
|
|
|
#include <float.h>
|
|
|
|
|
#define INFINITY (DBL_MAX + DBL_MAX)
|
|
|
|
|
#define HAVE_DECL_INFINITY
|
2014-03-09 16:41:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
2015-02-05 15:56:49 +00:00
|
|
|
#ifndef HAVE_DECL_NAN
|
|
|
|
|
#define NAN (INFINITY - INFINITY)
|
|
|
|
|
#define HAVE_DECL_NAN
|
2014-03-22 17:28:40 -04:00
|
|
|
#endif
|
|
|
|
|
|
2014-03-02 12:16:37 -05:00
|
|
|
#endif
|