On ARM/ARM64, long double is 64 bit. The __INFL constant is defined
as a bit pattern which only works for the x86 80 bit long floats.

Instead return INFINITY, which the compiler can convert properly to
whichever length long double happens to have.

This was the only function where __INFL is referenced directly.

Signed-off-by: Martin Storsjö <[email protected]>
---
 mingw-w64-crt/math/hypotl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mingw-w64-crt/math/hypotl.c b/mingw-w64-crt/math/hypotl.c
index 70a98dc08..563aeb498 100644
--- a/mingw-w64-crt/math/hypotl.c
+++ b/mingw-w64-crt/math/hypotl.c
@@ -23,7 +23,6 @@ Direct inquiries to 30 Frost Street, Cambridge, MA 02140
    by scalbnl to avoid duplicated range checks.
 */
 
-extern long double __INFL;
 #define PRECL 32
 
 long double
@@ -73,7 +72,7 @@ hypotl (long double x, long double y)
     if (exx > LDBL_MAX_EXP)
     {
       errno = ERANGE; 
-      return __INFL;
+      return INFINITY;
     }
   if (exx < LDBL_MIN_EXP)
     return 0.0L;
-- 
2.17.1



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to