cmath 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #include_next <cmath>
  3. #ifndef WAF_BUILD
  4. # ifdef __GLIBC__
  5. # if __GLIBC_PREREQ(2, 23)
  6. # define GLIBC_FIX_NEEDED 1
  7. # else
  8. # define GLIBC_FIX_NEEDED 0
  9. # endif
  10. # else
  11. # define GLIBC_FIX_NEEDED 0
  12. # endif
  13. # if GLIBC_FIX_NEEDED || defined (__CYGWIN__)
  14. # ifndef HAVE_CMATH_ISFINITE
  15. # define HAVE_CMATH_ISFINITE
  16. # define NEED_CMATH_ISFINITE_STD_NAMESPACE
  17. # endif
  18. # ifndef HAVE_CMATH_ISINF
  19. # define HAVE_CMATH_ISINF
  20. # define NEED_CMATH_ISINF_STD_NAMESPACE
  21. # endif
  22. # ifndef HAVE_CMATH_ISNAN
  23. # define HAVE_CMATH_ISNAN
  24. # define NEED_CMATH_ISNAN_STD_NAMESPACE
  25. # endif
  26. # undef GLIBC_FIX_NEEDED
  27. # endif
  28. #endif
  29. #ifdef WAF_BUILD
  30. #if defined(__CYGWIN__) || defined(__CYGWIN64__) || defined(CYGWIN_BUILD)
  31. // cygwin path length issues in configure mean these come out wrong,
  32. // so fix them here
  33. #ifndef HAVE_CMATH_ISFINITE
  34. # define HAVE_CMATH_ISFINITE
  35. # define NEED_CMATH_ISFINITE_STD_NAMESPACE
  36. #endif
  37. #ifndef HAVE_CMATH_ISINF
  38. # define HAVE_CMATH_ISINF
  39. # define NEED_CMATH_ISINF_STD_NAMESPACE
  40. #endif
  41. #ifndef HAVE_CMATH_ISNAN
  42. # define HAVE_CMATH_ISNAN
  43. # define NEED_CMATH_ISNAN_STD_NAMESPACE
  44. #endif
  45. #endif
  46. #endif
  47. #if defined(HAVE_CMATH_ISFINITE) && defined(NEED_CMATH_ISFINITE_STD_NAMESPACE)
  48. using std::isfinite;
  49. #endif
  50. #if defined(HAVE_CMATH_ISINF) && defined(NEED_CMATH_ISINF_STD_NAMESPACE)
  51. using std::isinf;
  52. #endif
  53. #if defined(HAVE_CMATH_ISNAN) && defined(NEED_CMATH_ISNAN_STD_NAMESPACE)
  54. using std::isnan;
  55. #endif