From 1694a0f2eb5246bd59399e153d61e5ce0fa2bedd Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 10 Oct 2011 01:57:56 +0200 Subject: [PATCH] mathfunc.m4: Refactor. * m4/mathfunc.m4 (gl_MATHFUNC): Assign the argument list to a temporary m4 variable. --- ChangeLog | 6 ++++++ m4/mathfunc.m4 | 24 +++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95f2b1d8c..d9419d250 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-10-09 Bruno Haible + mathfunc.m4: Refactor. + * m4/mathfunc.m4 (gl_MATHFUNC): Assign the argument list to a temporary + m4 variable. + +2011-10-09 Bruno Haible + rintl: Simplify for platforms where 'long double' == 'double'. * lib/rintl.c: Include . (rintl) [HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]: New function. diff --git a/m4/mathfunc.m4 b/m4/mathfunc.m4 index da6dc5ffe..698e18851 100644 --- a/m4/mathfunc.m4 +++ b/m4/mathfunc.m4 @@ -1,4 +1,4 @@ -# mathfunc.m4 serial 7 +# mathfunc.m4 serial 8 dnl Copyright (C) 2010-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -19,6 +19,23 @@ AC_DEFUN([gl_MATHFUNC], m4_pushdef([func], [$1]) m4_pushdef([FUNC], [m4_translit([$1],[abcdefghijklmnopqrstuvwxyz], [ABCDEFGHIJKLMNOPQRSTUVWXYZ])]) + m4_pushdef([ARGS], [m4_bpatsubst( + [m4_bpatsubst( + [m4_bpatsubst( + [m4_bpatsubst( + [m4_bpatsubst( + [m4_bpatsubst( + [m4_bpatsubst( + [m4_bpatsubst( + [$3], + [int \*], [&i_ret])], + [float \*], [&f_ret])], + [double \*], [&d_ret])], + [long double \*], [&l_ret])], + [int], [2])], + [float], [1.618034f])], + [long double], [1.618033988749894848L])], + [double], [1.6180339887])]) FUNC[]_LIBM= AC_CACHE_CHECK([whether func() can be used without linking with libm], [gl_cv_func_]func[_no_libm], @@ -34,7 +51,7 @@ AC_DEFUN([gl_MATHFUNC], float f_ret; double d_ret; long double l_ret;]], - [[$2 y = funcptr ]m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([$3], [int \*], [&i_ret])], [float \*], [&f_ret])], [double \*], [&d_ret])], [long double \*], [&l_ret])], [int], [2])], [float], [1.618034f])], [long double], [1.618033988749894848L])], [double], [1.6180339887])[; + [[$2 y = funcptr ]ARGS[; return y < 0.3 || y > 1.7; ]])], [gl_cv_func_]func[_no_libm=yes], @@ -57,7 +74,7 @@ AC_DEFUN([gl_MATHFUNC], float f_ret; double d_ret; long double l_ret;]], - [[$2 y = funcptr ]m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([m4_bpatsubst([$3], [int \*], [&i_ret])], [float \*], [&f_ret])], [double \*], [&d_ret])], [long double \*], [&l_ret])], [int], [2])], [float], [1.618034f])], [long double], [1.618033988749894848L])], [double], [1.6180339887])[; + [[$2 y = funcptr ]ARGS[; return y < 0.3 || y > 1.7; ]])], [gl_cv_func_]func[_in_libm=yes], @@ -69,6 +86,7 @@ AC_DEFUN([gl_MATHFUNC], fi fi AC_SUBST(FUNC[_LIBM]) + m4_popdef([ARGS]) m4_popdef([FUNC]) m4_popdef([func]) ]) -- 2.11.0