diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-07-30 14:27:29 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-07-30 14:27:29 -0400 |
commit | c2d5ec5e43c2690656ea5a5a384683108782d149 (patch) | |
tree | 0f9f9cd201c2d970170e98a5e94d713737a2e234 /src/lib/math/fp.c | |
parent | c4742b89b23d58958ee0d5ca324dac5948c94bf6 (diff) | |
parent | cdb0e6c2522aac372c9a816300dacfd62856dd48 (diff) | |
download | tor-c2d5ec5e43c2690656ea5a5a384683108782d149.tar.gz tor-c2d5ec5e43c2690656ea5a5a384683108782d149.zip |
Merge branch 'maint-0.4.2' into bug40076_042
Diffstat (limited to 'src/lib/math/fp.c')
-rw-r--r-- | src/lib/math/fp.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/lib/math/fp.c b/src/lib/math/fp.c index eafad358c3..49a2a6a2ca 100644 --- a/src/lib/math/fp.c +++ b/src/lib/math/fp.c @@ -75,7 +75,7 @@ clamp_double_to_int64(double number) */ #define PROBLEMATIC_FLOAT_CONVERSION_WARNING DISABLE_GCC_WARNING(float-conversion) -#endif /* defined(MINGW_ANY) && GCC_VERSION >= 409 */ +#endif /* (defined(MINGW_ANY)||defined(__FreeBSD__)) && GCC_VERSION >= 409 */ /* With clang 4.0 we apparently run into "double promotion" warnings here, @@ -121,3 +121,23 @@ ENABLE_GCC_WARNING(double-promotion) ENABLE_GCC_WARNING(float-conversion) #endif } + +/* isinf() wrapper for tor */ +int +tor_isinf(double x) +{ + /* Same as above, work around the "double promotion" warnings */ +#ifdef PROBLEMATIC_FLOAT_CONVERSION_WARNING +DISABLE_GCC_WARNING(float-conversion) +#endif +#ifdef PROBLEMATIC_DOUBLE_PROMOTION_WARNING +DISABLE_GCC_WARNING(double-promotion) +#endif + return isinf(x); +#ifdef PROBLEMATIC_DOUBLE_PROMOTION_WARNING +ENABLE_GCC_WARNING(double-promotion) +#endif +#ifdef PROBLEMATIC_FLOAT_CONVERSION_WARNING +ENABLE_GCC_WARNING(float-conversion) +#endif +} |