summaryrefslogtreecommitdiff
path: root/lib/math.in.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2016-12-17 19:41:12 +0100
committerBruno Haible <bruno@clisp.org>2016-12-17 23:09:07 +0100
commit21ec014a2ffe8d53dd1d4744ff5775853340e3cb (patch)
tree7523ff9087890c245d2d595bed9c20a374fdeced /lib/math.in.h
parentc3c53687f7772af44c67899be922b385a68533b0 (diff)
downloadgnulib-21ec014a2ffe8d53dd1d4744ff5775853340e3cb.tar.gz
expf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_EXPF. * m4/expf.m4 (gl_FUNC_EXPF): Set REPLACE_EXPF to 1 if the function may be defined as an inline function. * modules/math (Makefile.am): Substitute REPLACE_EXPF. * lib/math.in.h (expf): Override if REPLACE_EXPF is 1.
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 ccaf56cc7a..cc76a64ef0 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -589,11 +589,20 @@ _GL_WARN_ON_USE (coshf, "coshf is unportable - "
#if @GNULIB_EXPF@
-# if !@HAVE_EXPF@
-# undef expf
+# if @REPLACE_EXPF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef expf
+# define expf rpl_expf
+# endif
+_GL_FUNCDECL_RPL (expf, float, (float x));
+_GL_CXXALIAS_RPL (expf, float, (float x));
+# else
+# if !@HAVE_EXPF@
+# undef expf
_GL_FUNCDECL_SYS (expf, float, (float x));
-# endif
+# endif
_GL_CXXALIAS_SYS (expf, float, (float x));
+# endif
_GL_CXXALIASWARN (expf);
#elif defined GNULIB_POSIXCHECK
# undef expf