000-libm.patch 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --- a/math_compat.h
  2. +++ b/math_compat.h
  3. @@ -6,38 +6,9 @@
  4. * @brief Do not use, json-c internal, may be changed or removed at any time.
  5. */
  6. -/* Define isnan, isinf, infinity and nan on Windows/MSVC */
  7. -
  8. -#ifndef HAVE_DECL_ISNAN
  9. -#ifdef HAVE_DECL__ISNAN
  10. -#include <float.h>
  11. -#define isnan(x) _isnan(x)
  12. -#else
  13. -/* On platforms like AIX and "IBM i" we need to provide our own isnan */
  14. -#define isnan(x) ((x) != (x))
  15. -#endif
  16. -#endif
  17. -
  18. -#ifndef HAVE_DECL_ISINF
  19. -#ifdef HAVE_DECL__FINITE
  20. -#include <float.h>
  21. -#define isinf(x) (!_finite(x))
  22. -#else
  23. -#include <float.h>
  24. -/* On platforms like AIX and "IBM i" we need to provide our own isinf */
  25. -#define isinf(x) ((x) < -DBL_MAX || (x) > DBL_MAX)
  26. -#endif
  27. -#endif
  28. -
  29. -#ifndef HAVE_DECL_INFINITY
  30. -#include <float.h>
  31. -#define INFINITY (DBL_MAX + DBL_MAX)
  32. -#define HAVE_DECL_INFINITY
  33. -#endif
  34. -
  35. -#ifndef HAVE_DECL_NAN
  36. -#define NAN (INFINITY - INFINITY)
  37. -#define HAVE_DECL_NAN
  38. -#endif
  39. +#undef isnan
  40. +#define isnan(x) __builtin_isnan(x)
  41. +#undef isinf
  42. +#define isinf(x) __builtin_isinf(x)
  43. #endif