changeset 29156:40a998d0cb72

Use REPLACE_ROUND instead of HAVE_DECL_ROUND.
author Bruno Haible <bruno@clisp.org>
date Sun, 11 Nov 2007 13:58:25 +0100
parents df0410b0ec05
children cdb477ad0ff2
files ChangeLog lib/math.in.h m4/math_h.m4 m4/round.m4 m4/roundf.m4 m4/roundl.m4 modules/math
diffstat 7 files changed, 39 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Nov 11 01:37:52 2007 +0100
+++ b/ChangeLog	Sun Nov 11 13:58:25 2007 +0100
@@ -1,3 +1,19 @@
+2007-11-11  Bruno Haible  <bruno@clisp.org>
+
+	* m4/roundf.m4 (gl_FUNC_ROUNDF): Set REPLACE_ROUNDF instead of
+	HAVE_DECL_ROUNDF. Remove redundant AC_SUBST.
+	* m4/round.m4 (gl_FUNC_ROUND): Set REPLACE_ROUND instead of
+	HAVE_DECL_ROUND. Remove redundant AC_SUBST.
+	* m4/roundl.m4 (gl_FUNC_ROUNDL): Set REPLACE_ROUNDL instead of
+	HAVE_DECL_ROUNDL. Remove redundant AC_SUBST.
+	* lib/math.in.h (roundf): Use REPLACE_ROUNDF instead of
+	HAVE_DECL_ROUNDF.
+	(round): Use REPLACE_ROUND instead of HAVE_DECL_ROUND.
+	(roundl): Use REPLACE_ROUNDL instead of HAVE_DECL_ROUNDL.
+	* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize REPLACE_ROUND* instead
+	of HAVE_DECL_ROUND*.
+	* modules/math (Makefile.am): Update.
+
 2007-11-10  Bruno Haible  <bruno@clisp.org>
 
 	* m4/vasnprintf.m4 (gl_PREREQ_PRINTF_PARSE): Use same check for
--- a/lib/math.in.h	Sun Nov 11 01:37:52 2007 +0100
+++ b/lib/math.in.h	Sun Nov 11 13:58:25 2007 +0100
@@ -218,7 +218,7 @@
 
 
 #if @GNULIB_ROUNDF@
-# if !@HAVE_DECL_ROUNDF@
+# if @REPLACE_ROUNDF@
 #  undef roundf
 #  define roundf rpl_roundf
 extern float roundf (float x);
@@ -232,7 +232,7 @@
 #endif
 
 #if @GNULIB_ROUND@
-# if !@HAVE_DECL_ROUND@
+# if @REPLACE_ROUND@
 #  undef round
 #  define round rpl_round
 extern double round (double x);
@@ -246,7 +246,7 @@
 #endif
 
 #if @GNULIB_ROUNDL@
-# if !@HAVE_DECL_ROUNDL@
+# if @REPLACE_ROUNDL@
 #  undef roundl
 #  define roundl rpl_roundl
 extern long double roundl (long double x);
--- a/m4/math_h.m4	Sun Nov 11 01:37:52 2007 +0100
+++ b/m4/math_h.m4	Sun Nov 11 13:58:25 2007 +0100
@@ -1,4 +1,4 @@
-# math_h.m4 serial 7
+# math_h.m4 serial 8
 dnl Copyright (C) 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -44,9 +44,6 @@
   HAVE_DECL_FREXPL=1;   AC_SUBST([HAVE_DECL_FREXPL])
   HAVE_DECL_LDEXPL=1;   AC_SUBST([HAVE_DECL_LDEXPL])
   HAVE_DECL_LOGL=1;     AC_SUBST([HAVE_DECL_LOGL])
-  HAVE_DECL_ROUND=1;    AC_SUBST([HAVE_DECL_ROUND])
-  HAVE_DECL_ROUNDF=1;   AC_SUBST([HAVE_DECL_ROUNDF])
-  HAVE_DECL_ROUNDL=1;   AC_SUBST([HAVE_DECL_ROUNDL])
   HAVE_DECL_SINL=1;     AC_SUBST([HAVE_DECL_SINL])
   HAVE_DECL_SQRTL=1;    AC_SUBST([HAVE_DECL_SQRTL])
   HAVE_DECL_TANL=1;     AC_SUBST([HAVE_DECL_TANL])
@@ -61,5 +58,8 @@
   REPLACE_FREXPL=0;     AC_SUBST([REPLACE_FREXPL])
   REPLACE_ISFINITE=0;   AC_SUBST([REPLACE_ISFINITE])
   REPLACE_LDEXPL=0;     AC_SUBST([REPLACE_LDEXPL])
+  REPLACE_ROUND=0;      AC_SUBST([REPLACE_ROUND])
+  REPLACE_ROUNDF=0;     AC_SUBST([REPLACE_ROUNDF])
+  REPLACE_ROUNDL=0;     AC_SUBST([REPLACE_ROUNDL])
   REPLACE_SIGNBIT=0;    AC_SUBST([REPLACE_SIGNBIT])
 ])
--- a/m4/round.m4	Sun Nov 11 01:37:52 2007 +0100
+++ b/m4/round.m4	Sun Nov 11 13:58:25 2007 +0100
@@ -1,4 +1,4 @@
-# round.m4 serial 3
+# round.m4 serial 4
 dnl Copyright (C) 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,9 +14,8 @@
     gl_CHECK_MATH_LIB([ROUND_LIBM], [x = round (x);])
   fi
   if test "$ac_cv_have_decl_round" != yes || test "$ROUND_LIBM" = missing; then
-    gl_CHECK_MATH_LIB([ROUND_LIBM], [x = floor (x) + ceil (x);])
-    HAVE_DECL_ROUND=0
+    REPLACE_ROUND=1
     AC_LIBOBJ([round])
+    gl_CHECK_MATH_LIB([ROUND_LIBM], [x = floor (x) + ceil (x);])
   fi
-  AC_SUBST([HAVE_DECL_ROUND])
   AC_SUBST([ROUND_LIBM])])
--- a/m4/roundf.m4	Sun Nov 11 01:37:52 2007 +0100
+++ b/m4/roundf.m4	Sun Nov 11 13:58:25 2007 +0100
@@ -1,4 +1,4 @@
-# roundf.m4 serial 3
+# roundf.m4 serial 4
 dnl Copyright (C) 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,16 +14,15 @@
     gl_CHECK_MATH_LIB([ROUNDF_LIBM], [x = roundf (x);])
   fi
   if test "$ac_cv_have_decl_roundf" != yes || test "$ROUNDF_LIBM" = missing; then
+    REPLACE_ROUNDF=1
+    AC_LIBOBJ([roundf])
     AC_CHECK_DECLS([ceilf, floorf], , , [#include <math.h>])
-    if test "$ac_cv_have_decl_floorf" = yes &&
-       test "$ac_cv_have_decl_ceilf" = yes; then
+    if test "$ac_cv_have_decl_floorf" = yes \
+       && test "$ac_cv_have_decl_ceilf" = yes; then
       gl_CHECK_MATH_LIB([ROUNDF_LIBM], [x = floorf (x) + ceilf (x);])
     else
       ROUNDF_LIBM=
     fi
-    HAVE_DECL_ROUNDF=0
-    AC_LIBOBJ([roundf])
   fi
-  AC_SUBST([HAVE_DECL_ROUNDF])
   AC_SUBST([ROUNDF_LIBM])
 ])
--- a/m4/roundl.m4	Sun Nov 11 01:37:52 2007 +0100
+++ b/m4/roundl.m4	Sun Nov 11 13:58:25 2007 +0100
@@ -1,4 +1,4 @@
-# roundl.m4 serial 3
+# roundl.m4 serial 4
 dnl Copyright (C) 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,16 +14,15 @@
     gl_CHECK_MATH_LIB([ROUNDL_LIBM], [x = roundl (x);])
   fi
   if test "$ac_cv_have_decl_roundl" != yes || test "$ROUNDL_LIBM" = missing; then
+    REPLACE_ROUNDL=1
+    AC_LIBOBJ([roundl])
     AC_CHECK_DECLS([ceill, floorl], , , [#include <math.h>])
-    if test "$ac_cv_have_decl_floorl" = yes &&
-       test "$ac_cv_have_decl_ceill" = yes; then
+    if test "$ac_cv_have_decl_floorl" = yes \
+       && test "$ac_cv_have_decl_ceill" = yes; then
       gl_CHECK_MATH_LIB([ROUNDL_LIBM], [x = floorl (x) + ceill (x);])
     else
       ROUNDL_LIBM=
     fi
-    HAVE_DECL_ROUNDL=0
-    AC_LIBOBJ([roundl])
   fi
-  AC_SUBST([HAVE_DECL_ROUNDL])
   AC_SUBST([ROUNDL_LIBM])
 ])
--- a/modules/math	Sun Nov 11 01:37:52 2007 +0100
+++ b/modules/math	Sun Nov 11 13:58:25 2007 +0100
@@ -46,9 +46,6 @@
 	      -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \
 	      -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \
 	      -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \
-	      -e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \
-	      -e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \
-	      -e 's|@''HAVE_DECL_ROUNDL''@|$(HAVE_DECL_ROUNDL)|g' \
 	      -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \
 	      -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \
 	      -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \
@@ -63,6 +60,9 @@
 	      -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \
 	      -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \
 	      -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \
+	      -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \
+	      -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \
+	      -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
 	      -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
 	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
 	      < $(srcdir)/math.in.h; \