Alexandre Julliard : include: Use gcc builtin for HUGE_VAL.
Alexandre Julliard
julliard at winehq.org
Thu Nov 19 16:10:22 CST 2020
Module: wine
Branch: master
Commit: 32eae49275be2c9ffa8e92ce48ce77ca1f703d16
URL: https://source.winehq.org/git/wine.git/?a=commit;h=32eae49275be2c9ffa8e92ce48ce77ca1f703d16
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Nov 19 13:29:01 2020 +0100
include: Use gcc builtin for HUGE_VAL.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
include/msvcrt/math.h | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/include/msvcrt/math.h b/include/msvcrt/math.h
index a6bcbf9ada6..615f9a6bf24 100644
--- a/include/msvcrt/math.h
+++ b/include/msvcrt/math.h
@@ -201,21 +201,10 @@ float __cdecl _hypotf(float, float);
int __cdecl _matherr(struct _exception*);
double __cdecl _cabs(struct _complex);
-#ifndef HUGE_VAL
-# if defined(__GNUC__) && (__GNUC__ >= 3)
-# define HUGE_VAL (__extension__ 0x1.0p2047)
-# else
-static const union {
- unsigned char __c[8];
- double __d;
-} __huge_val = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
-# define HUGE_VAL (__huge_val.__d)
-# endif
-#endif
-
#if (defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))) || defined(__clang__)
# define INFINITY __builtin_inff()
# define NAN __builtin_nanf("")
+# define HUGE_VAL __builtin_huge_val()
#else
static const union {
unsigned int __i;
@@ -223,6 +212,7 @@ static const union {
} __inff = { 0x7f800000 }, __nanf = { 0x7fc00000 };
# define INFINITY (__inff.__f)
# define NAN (__nanf.__f)
+# define HUGE_VAL ((double)INFINITY)
#endif
#define FP_INFINITE 1
More information about the wine-cvs
mailing list