Use HUGE_VALL if applicable.
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 1 May 2000 22:50:11 +0000 (22:50 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 1 May 2000 22:50:11 +0000 (22:50 +0000)
p4raw-id: //depot/cfgperl@6037

ext/POSIX/POSIX.xs
util.c

index 3a523d1..9f1e855 100644 (file)
@@ -1517,6 +1517,15 @@ constant(char *name, int arg)
        break;
     case 'H':
        if (strEQ(name, "HUGE_VAL"))
+#ifdef USE_LONG_DOUBLE 
+         /* HUGE_VALL is admittedly non-POSIX but if are using long doubles
+          * we might as well use long doubles. --jhi */
+#   ifdef HUGE_VALL
+           return HUGE_VALL;
+#   else
+           goto not_there;
+#   endif
+#endif
 #ifdef HUGE_VAL
            return HUGE_VAL;
 #else
diff --git a/util.c b/util.c
index 059d9a4..41ded13 100644 (file)
--- a/util.c
+++ b/util.c
@@ -3577,7 +3577,7 @@ Perl_new_struct_thread(pTHX_ struct perl_thread *t)
 }
 #endif /* USE_THREADS */
 
-#ifdef HUGE_VAL
+#if defined(HUGE_VAL) || (defined(USE_LONG_DOUBLE) && defined(HUGE_VALL))
 /*
  * This hack is to force load of "huge" support from libm.a
  * So it is in perl for (say) POSIX to use. 
@@ -3586,7 +3586,10 @@ Perl_new_struct_thread(pTHX_ struct perl_thread *t)
 NV 
 Perl_huge(void)
 {
- return HUGE_VAL;
+#   if defined(USE_LONG_DOUBLE) && defined(HUGE_VALL)
+    return HUGE_VALL;
+#   endif
+    return HUGE_VAL;
 }
 #endif