Commit 21e68e54 authored by Bruno Haible's avatar Bruno Haible

Use REPLACE_ROUND instead of HAVE_DECL_ROUND.

parent bb47b632
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
......@@ -218,7 +218,7 @@ extern long double logl (long double x);
#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 @@ extern float roundf (float x);
#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 @@ extern double round (double x);
#endif
#if @GNULIB_ROUNDL@
# if !@HAVE_DECL_ROUNDL@
# if @REPLACE_ROUNDL@
# undef roundl
# define roundl rpl_roundl
extern long double roundl (long double x);
......
# 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 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
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 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
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])
])
# 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 @@ AC_DEFUN([gl_FUNC_ROUND],
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])])
# 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 @@ AC_DEFUN([gl_FUNC_ROUNDF],
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])
])
# 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 @@ AC_DEFUN([gl_FUNC_ROUNDL],
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])
])
......@@ -46,9 +46,6 @@ math.h: math.in.h
-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 @@ math.h: math.in.h
-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; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment