000-libm.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --- a/configure.ac
  2. +++ b/configure.ac
  3. @@ -43,12 +43,6 @@ AC_FUNC_MEMCMP
  4. AC_FUNC_MALLOC
  5. AC_FUNC_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. #check if .section.gnu.warning accepts long strings (for __warn_references)
  14. AC_LANG_PUSH([C])
  15. --- a/math_compat.h
  16. +++ b/math_compat.h
  17. @@ -1,28 +1,9 @@
  18. #ifndef __math_compat_h
  19. #define __math_compat_h
  20. -/* Define isnan and isinf on Windows/MSVC */
  21. -
  22. -#ifndef HAVE_DECL_ISNAN
  23. -# ifdef HAVE_DECL__ISNAN
  24. -#include <float.h>
  25. -#define isnan(x) _isnan(x)
  26. -# endif
  27. -#endif
  28. -
  29. -#ifndef HAVE_DECL_ISINF
  30. -# ifdef HAVE_DECL__FINITE
  31. -#include <float.h>
  32. -#define isinf(x) (!_finite(x))
  33. -# endif
  34. -#endif
  35. -
  36. -#ifndef HAVE_DECL_NAN
  37. -#error This platform does not have nan()
  38. -#endif
  39. -
  40. -#ifndef HAVE_DECL_INFINITY
  41. -#error This platform does not have INFINITY
  42. -#endif
  43. +#undef isnan
  44. +#define isnan(x) __builtin_isnan(x)
  45. +#undef isinf
  46. +#define isinf(x) __builtin_isinf(x)
  47. #endif