000-libm.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --- a/configure.ac
  2. +++ b/configure.ac
  3. @@ -76,12 +76,6 @@ AC_FUNC_VPRINTF
  4. AC_FUNC_MEMCMP
  5. AC_CHECK_FUNCS([realloc])
  6. AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale)
  7. -AC_CHECK_DECLS([INFINITY], [], [], [[#include <math.h>]])
  8. -AC_CHECK_DECLS([nan], [], [], [[#include <math.h>]])
  9. -AC_CHECK_DECLS([isnan], [], [], [[#include <math.h>]])
  10. -AC_CHECK_DECLS([isinf], [], [], [[#include <math.h>]])
  11. -AC_CHECK_DECLS([_isnan], [], [], [[#include <float.h>]])
  12. -AC_CHECK_DECLS([_finite], [], [], [[#include <float.h>]])
  13. AC_MSG_CHECKING(for GCC atomic builtins)
  14. AC_LINK_IFELSE(
  15. [
  16. --- a/math_compat.h
  17. +++ b/math_compat.h
  18. @@ -6,31 +6,9 @@
  19. * @brief Do not use, json-c internal, may be changed or removed at any time.
  20. */
  21. -/* Define isnan, isinf, infinity and nan on Windows/MSVC */
  22. -
  23. -#ifndef HAVE_DECL_ISNAN
  24. -# ifdef HAVE_DECL__ISNAN
  25. -#include <float.h>
  26. -#define isnan(x) _isnan(x)
  27. -# endif
  28. -#endif
  29. -
  30. -#ifndef HAVE_DECL_ISINF
  31. -# ifdef HAVE_DECL__FINITE
  32. -#include <float.h>
  33. -#define isinf(x) (!_finite(x))
  34. -# endif
  35. -#endif
  36. -
  37. -#ifndef HAVE_DECL_INFINITY
  38. -#include <float.h>
  39. -#define INFINITY (DBL_MAX + DBL_MAX)
  40. -#define HAVE_DECL_INFINITY
  41. -#endif
  42. -
  43. -#ifndef HAVE_DECL_NAN
  44. -#define NAN (INFINITY - INFINITY)
  45. -#define HAVE_DECL_NAN
  46. -#endif
  47. +#undef isnan
  48. +#define isnan(x) __builtin_isnan(x)
  49. +#undef isinf
  50. +#define isinf(x) __builtin_isinf(x)
  51. #endif