From 7c193d625308bb806418c61ec9062fc22a29aeaf Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 6 Mar 2012 23:25:51 +0100 Subject: Work around expm1f bug on IRIX 6.5. * lib/math.in.h (expm1f): Override if REPLACE_EXPM1F is 1. * m4/expm1f.m4 (gl_FUNC_EXPM1F_WORKS): New macro. (gl_FUNC_EXPM1F): Invoke it. Set REPLACE_EXPM1F to 1 if expm1f() does not work. * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize REPLACE_EXPM1F. * modules/math (Makefile.am): Substitute REPLACE_EXPM1F. * modules/expm1f (configure.ac): Consider REPLACE_EXPM1F. (Depends-on): Update conditions. * doc/posix-functions/expm1f.texi: Mention the IRIX 6.5 bug. --- lib/math.in.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/math.in.h') diff --git a/lib/math.in.h b/lib/math.in.h index 5413d3a160..c57e48bb9e 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -533,10 +533,19 @@ _GL_WARN_ON_USE (expl, "expl is unportable - " #if @GNULIB_EXPM1F@ -# if !@HAVE_EXPM1F@ +# if @REPLACE_EXPM1F@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef expm1f +# define expm1f rpl_expm1f +# endif +_GL_FUNCDECL_RPL (expm1f, float, (float x)); +_GL_CXXALIAS_RPL (expm1f, float, (float x)); +# else +# if !@HAVE_EXPM1F@ _GL_FUNCDECL_SYS (expm1f, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (expm1f, float, (float x)); +# endif _GL_CXXALIASWARN (expm1f); #elif defined GNULIB_POSIXCHECK # undef expm1f -- cgit v1.2.1