diff options
Diffstat (limited to 'src/lib/math/fp.c')
-rw-r--r-- | src/lib/math/fp.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/math/fp.c b/src/lib/math/fp.c index eafad358c3..616e4f15c0 100644 --- a/src/lib/math/fp.c +++ b/src/lib/math/fp.c @@ -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 +} |