mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Merge branch 'maint-0.2.9' into maint-0.3.0
This commit is contained in:
commit
8bc70a2ad2
5
changes/bug22801
Normal file
5
changes/bug22801
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
o Minor bugfixes (compilation):
|
||||||
|
- When building with certain versions the mingw C header files, avoid
|
||||||
|
float-conversion warnings when calling the C functions isfinite(),
|
||||||
|
isnan(), and signbit(). Fixes bug 22801; bugfix on 0.2.8.1-alpha.
|
||||||
|
|
@ -5734,6 +5734,15 @@ clamp_double_to_int64(double number)
|
|||||||
{
|
{
|
||||||
int exponent;
|
int exponent;
|
||||||
|
|
||||||
|
#if defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
|
/*
|
||||||
|
Mingw's math.h uses gcc's __builtin_choose_expr() facility to declare
|
||||||
|
isnan, isfinite, and signbit. But as implemented in at least some
|
||||||
|
versions of gcc, __builtin_choose_expr() can generate type warnings
|
||||||
|
even from branches that are not taken. So, suppress those warnings.
|
||||||
|
*/
|
||||||
|
DISABLE_GCC_WARNING(float-conversion)
|
||||||
|
#endif
|
||||||
/* NaN is a special case that can't be used with the logic below. */
|
/* NaN is a special case that can't be used with the logic below. */
|
||||||
if (isnan(number)) {
|
if (isnan(number)) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -5759,6 +5768,9 @@ clamp_double_to_int64(double number)
|
|||||||
|
|
||||||
/* Handle infinities and finite numbers with magnitude >= 2^63. */
|
/* Handle infinities and finite numbers with magnitude >= 2^63. */
|
||||||
return signbit(number) ? INT64_MIN : INT64_MAX;
|
return signbit(number) ? INT64_MIN : INT64_MAX;
|
||||||
|
#if defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
|
ENABLE_GCC_WARNING(float-conversion)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return a uint64_t value from <b>a</b> in network byte order. */
|
/** Return a uint64_t value from <b>a</b> in network byte order. */
|
||||||
|
Loading…
Reference in New Issue
Block a user