diff options
author | Kevin Newton <[email protected]> | 2024-12-11 19:55:13 -0500 |
---|---|---|
committer | git <[email protected]> | 2024-12-12 01:10:13 +0000 |
commit | 29caae9991f08fb386c414f4c6270c68cdf69c30 (patch) | |
tree | f0e4a860206c7015bb9d95b06fe0e649acf1f78c /prism/defines.h | |
parent | 36f49eb2b48d855fd168bf5371c9932e35c8029b (diff) |
[ruby/prism] Use isinf on non-mingw windowsv3_4_0_rc1
https://github.com/ruby/prism/commit/2f903d7865
Diffstat (limited to 'prism/defines.h')
-rw-r--r-- | prism/defines.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/prism/defines.h b/prism/defines.h index 80db39bc77..f7bb2120c4 100644 --- a/prism/defines.h +++ b/prism/defines.h @@ -138,10 +138,14 @@ /** * isinf on POSIX systems it accepts a float, a double, or a long double. - * But Windows didn't provide isinf, so we need to use _finite instead. + * But mingw didn't provide an isinf macro, only an isinf function that only + * accepts floats, so we need to use _finite instead. */ -#ifdef _WIN32 -# include <float.h> +#ifdef __MINGW64__ + #include <float.h> + #define PRISM_ISINF(x) (!_finite(x)) +#else + #define PRISM_ISINF(x) isinf(x) #endif /** |