stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r386889 - /incubator/stdcxx/trunk/etc/config/src/FLOAT.cpp
Date Sat, 18 Mar 2006 22:04:50 GMT
Author: sebor
Date: Sat Mar 18 14:04:49 2006
New Revision: 386889

URL: http://svn.apache.org/viewcvs?rev=386889&view=rev
Log:
2006-03-18  Martin Sebor  <sebor@roguewave.com>

	STDCXX-164
	* FLOAT.cpp (strtold): Checked _LONG_DOUBLE in addition to __hpux
	before using struct long_double in case the struct is not defined
	e.g., when using gcc's replacement <stdlib.h> on HP-UX.

Modified:
    incubator/stdcxx/trunk/etc/config/src/FLOAT.cpp

Modified: incubator/stdcxx/trunk/etc/config/src/FLOAT.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/src/FLOAT.cpp?rev=386889&r1=386888&r2=386889&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/FLOAT.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/FLOAT.cpp Sat Mar 18 14:04:49 2006
@@ -294,12 +294,17 @@
 
     errno = 0;
 
-#    if !defined (__hpux)
+#    if !defined (__hpux) || !defined (_LONG_DOUBLE)
+
+    // HP-UX strtold() returns struct long_double
+    // the macro _LONG_DOUBLE is #defined when the struct is defined
+    // note that gcc's replacement <stdlib.h> may actually define the
+    // function with the correct signature
 
     // determine whether strtold() sets errno on underflow
     const long double ld = strtold ("1.0e-9999", (char**)0);
 
-#    else
+#    else   // HP-UX with _LONG_DOUBLE #defined
 
     union {
         long double ld;
@@ -309,7 +314,7 @@
     ldu.data = strtold ("1.0e-9999", (char**)0);
     const long double ld = ldu.ld;
 
-#    endif   // __hpux
+#    endif   // HP-UX, _LONG_DOUBLE
 
     if (ld < 0.0 || ld > 1.0 || !errno)
         printf ("#define _RWSTD_NO_STRTOLD_UFLOW\n");



Mime
View raw message