changeset 31197:77416028528f

Avoid link error when creating a namespace clean library.
author Bruno Haible <bruno@clisp.org>
date Sat, 25 Apr 2009 17:22:50 +0200
parents 0ac998d8d8c3
children ba3299adf742
files ChangeLog lib/math.in.h lib/signbitd.c lib/signbitf.c lib/signbitl.c
diffstat 5 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Apr 25 15:32:33 2009 +0200
+++ b/ChangeLog	Sat Apr 25 17:22:50 2009 +0200
@@ -1,3 +1,12 @@
+2009-04-25  Bruno Haible  <bruno@clisp.org>
+
+	Avoid link error when creating a namespace clean library.
+	* lib/math.in.h (gl_signbitf, gl_signbitd, gl_signbitl): Don't define
+	as macro with arguments if already defined as an alias.
+	* lib/signbitf.c (gl_signbitf): Don't undefine.
+	* lib/signbitd.c (gl_signbitd): Don't undefine.
+	* lib/signbitl.c (gl_signbitl): Don't undefine.
+
 2009-04-25  Jim Meyering  <meyering@redhat.com>
 
 	vc-list-files: fix another quoting bug
--- a/lib/math.in.h	Sat Apr 25 15:32:33 2009 +0200
+++ b/lib/math.in.h	Sat Apr 25 17:22:50 2009 +0200
@@ -1,6 +1,6 @@
 /* A GNU-like <math.h>.
 
-   Copyright (C) 2002-2003, 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -518,7 +518,7 @@
 extern int gl_signbitd (double arg);
 extern int gl_signbitl (long double arg);
 #  if __GNUC__ >= 2 && !__STRICT_ANSI__
-#   if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT
+#   if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
 #    define gl_signbitf(arg) \
        ({ union { float _value;						\
                   unsigned int _word[(sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \
@@ -527,7 +527,7 @@
           (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1;		\
         })
 #   endif
-#   if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT
+#   if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd
 #    define gl_signbitd(arg) \
        ({ union { double _value;						\
                   unsigned int _word[(sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \
@@ -536,7 +536,7 @@
           (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1;		\
         })
 #   endif
-#   if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT
+#   if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined gl_signbitl
 #    define gl_signbitl(arg) \
        ({ union { long double _value;					\
                   unsigned int _word[(sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \
--- a/lib/signbitd.c	Sat Apr 25 15:32:33 2009 +0200
+++ b/lib/signbitd.c	Sat Apr 25 17:22:50 2009 +0200
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -23,8 +23,6 @@
 #include "isnand-nolibm.h"
 #include "float+.h"
 
-#undef gl_signbitd
-
 int
 gl_signbitd (double arg)
 {
--- a/lib/signbitf.c	Sat Apr 25 15:32:33 2009 +0200
+++ b/lib/signbitf.c	Sat Apr 25 17:22:50 2009 +0200
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -23,8 +23,6 @@
 #include "isnanf-nolibm.h"
 #include "float+.h"
 
-#undef gl_signbitf
-
 int
 gl_signbitf (float arg)
 {
--- a/lib/signbitl.c	Sat Apr 25 15:32:33 2009 +0200
+++ b/lib/signbitl.c	Sat Apr 25 17:22:50 2009 +0200
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -23,8 +23,6 @@
 #include "isnanl-nolibm.h"
 #include "float+.h"
 
-#undef gl_signbitl
-
 int
 gl_signbitl (long double arg)
 {