Fix typo in last commit.
[pspp] / m4 / signbit.m4
index 17484532b37e76c18f3498ec85ba7fadc3c097aa..e9c1e37f3fed01281b12446818fac11b63924a06 100644 (file)
@@ -1,4 +1,4 @@
-# signbit.m4 serial 3
+# signbit.m4 serial 4
 dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -123,17 +123,25 @@ AC_DEFUN([gl_SIGNBIT],
   fi
 ])
 
-AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [
+AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[
+int main ()
+{
 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
-   So we use -p0f instead.  */
+   So we use -p0f and -p0d instead.  */
 float p0f = 0.0f;
 float m0f = -p0f;
 double p0d = 0.0;
 double m0d = -p0d;
+/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
+   So we use another constant expression instead.
+   But that expression does not work on other platforms, such as when
+   cross-compiling to PowerPC on MacOS X 10.5.  */
 long double p0l = 0.0L;
+#if defined __hpux || defined __sgi
+long double m0l = -LDBL_MIN * LDBL_MIN;
+#else
 long double m0l = -p0l;
-int main ()
-{
+#endif
   {
     float plus_inf = 1.0f / p0f;
     float minus_inf = -1.0f / p0f;
@@ -169,7 +177,7 @@ int main ()
   }
   return 0;
 }
-])
+]])
 
 AC_DEFUN([gl_FLOAT_SIGN_LOCATION],
 [