summaryrefslogtreecommitdiff
path: root/lib/math.in.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-01-20 22:28:37 +0100
committerBruno Haible <bruno@clisp.org>2019-01-20 22:28:37 +0100
commit67df3cffac300d320307e8d7e494029098edc334 (patch)
tree16ec07f4fce54882c37030bef086e3c357f60f00 /lib/math.in.h
parent0ac7b4317dbe2247c520d0f786926e9e520ba81c (diff)
downloadgnulib-67df3cffac300d320307e8d7e494029098edc334.tar.gz
expm1l: Work around inaccurate implementation on NetBSD.
* lib/math.in.h (expm1l): Test also REPLACE_EXPM1L. * m4/expm1l.m4 (gl_FUNC_EXPM1L): Add test for a certain accuracy. Set REPLACE_EXPM1L. * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize REPLACE_EXPM1L. * modules/math (Makefile.in): Substitute REPLACE_EXPM1L. * modules/expm1l (Depends-on, configure.ac): Test REPLACE_EXPM1L. * doc/posix-functions/expm1l.texi: Mention the NetBSD bug.
Diffstat (limited to 'lib/math.in.h')
-rw-r--r--lib/math.in.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/math.in.h b/lib/math.in.h
index c5f9b466b1..270caaf4c8 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -760,11 +760,20 @@ _GL_WARN_ON_USE (expm1, "expm1 is unportable - "
#endif
#if @GNULIB_EXPM1L@
-# if !@HAVE_DECL_EXPM1L@
-# undef expm1l
+# if @REPLACE_EXPM1L@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef expm1l
+# define expm1l rpl_expm1l
+# endif
+_GL_FUNCDECL_RPL (expm1l, long double, (long double x));
+_GL_CXXALIAS_RPL (expm1l, long double, (long double x));
+# else
+# if !@HAVE_DECL_EXPM1L@
+# undef expm1l
_GL_FUNCDECL_SYS (expm1l, long double, (long double x));
-# endif
+# endif
_GL_CXXALIAS_SYS (expm1l, long double, (long double x));
+# endif
_GL_CXXALIASWARN (expm1l);
#elif defined GNULIB_POSIXCHECK
# undef expm1l