diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-09-12 09:53:13 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-09-12 09:53:13 -0400 |
commit | 34bab120df213970edf32db1f3462ff2585ee098 (patch) | |
tree | 50de9f491429d41709445a3c5eba28669ef2b342 /src/lib/math | |
parent | 0327f9a0757e202666ec54460a69303633af4b33 (diff) | |
download | tor-34bab120df213970edf32db1f3462ff2585ee098.tar.gz tor-34bab120df213970edf32db1f3462ff2585ee098.zip |
Ticket 31687: fix for tor_isinf() as well
tor_isinf() was new in 0.4.0, and also needs to look at the
same rules as clamp_double_to_i64()
Diffstat (limited to 'src/lib/math')
-rw-r--r-- | src/lib/math/fp.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/lib/math/fp.c b/src/lib/math/fp.c index 9d93eaa878..616e4f15c0 100644 --- a/src/lib/math/fp.c +++ b/src/lib/math/fp.c @@ -127,16 +127,12 @@ int tor_isinf(double x) { /* Same as above, work around the "double promotion" warnings */ -#if defined(MINGW_ANY) && GCC_VERSION >= 409 -#define PROBLEMATIC_FLOAT_CONVERSION_WARNING +#ifdef PROBLEMATIC_FLOAT_CONVERSION_WARNING DISABLE_GCC_WARNING(float-conversion) -#endif /* defined(MINGW_ANY) && GCC_VERSION >= 409 */ -#if defined(__clang__) -#if __has_warning("-Wdouble-promotion") -#define PROBLEMATIC_DOUBLE_PROMOTION_WARNING +#endif +#ifdef PROBLEMATIC_DOUBLE_PROMOTION_WARNING DISABLE_GCC_WARNING(double-promotion) #endif -#endif /* defined(__clang__) */ return isinf(x); #ifdef PROBLEMATIC_DOUBLE_PROMOTION_WARNING ENABLE_GCC_WARNING(double-promotion) @@ -145,4 +141,3 @@ ENABLE_GCC_WARNING(double-promotion) ENABLE_GCC_WARNING(float-conversion) #endif } - |