# HG changeset patch # User Bruno Haible # Date 1228786100 -3600 # Node ID dc5daffec1821f2512b560bf7a14975f02ebaad1 # Parent 69048e86dbdfd7dfd9d5ca9a2427a174eed97d05 Detect a dysfunctional signbit macro on MacOS X 10.4/PowerPC. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-08 Bruno Haible + + * m4/signbitl.m4 (gl_SIGNBIT_TEST_PROGRAM): Add a link check of signbit + applied to variables. Needed on MacOS X 10.4/PowerPC. + Reported by Simon Josefsson. + 2008-12-08 William Pursell (tiny change) and Eric Blake diff --git a/m4/signbit.m4 b/m4/signbit.m4 --- a/m4/signbit.m4 +++ b/m4/signbit.m4 @@ -1,4 +1,4 @@ -# signbit.m4 serial 4 +# signbit.m4 serial 5 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, @@ -124,6 +124,12 @@ ]) AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[ +/* Global variables. + Needed because GCC 4 constant-folds __builtin_signbitl (literal) + but cannot constant-fold __builtin_signbitl (variable). */ +float vf; +double vd; +long double vl; int main () { /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. @@ -142,6 +148,8 @@ #else long double m0l = -p0l; #endif + if (signbit (vf)) + vf++; { float plus_inf = 1.0f / p0f; float minus_inf = -1.0f / p0f; @@ -153,6 +161,8 @@ && signbit (minus_inf))) return 1; } + if (signbit (vd)) + vd++; { double plus_inf = 1.0 / p0d; double minus_inf = -1.0 / p0d; @@ -164,6 +174,8 @@ && signbit (minus_inf))) return 1; } + if (signbit (vl)) + vl++; { long double plus_inf = 1.0L / p0l; long double minus_inf = -1.0L / p0l;