* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_COSHF.
* m4/coshf.m4 (gl_FUNC_COSHF): Set REPLACE_COSHF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_COSHF.
* lib/math.in.h (coshf): Override if REPLACE_COSHF is 1.
+2016-12-17 Bruno Haible <bruno@clisp.org>
+
+ coshf: Avoid redefinition error on MSVC.
+ * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_COSHF.
+ * m4/coshf.m4 (gl_FUNC_COSHF): Set REPLACE_COSHF to 1 if the function
+ may be defined as an inline function.
+ * modules/math (Makefile.am): Substitute REPLACE_COSHF.
+ * lib/math.in.h (coshf): Override if REPLACE_COSHF is 1.
+
2016-12-17 Bruno Haible <bruno@clisp.org>
cosf: Avoid redefinition error on MSVC.
#if @GNULIB_COSHF@
-# if !@HAVE_COSHF@
-# undef coshf
+# if @REPLACE_COSHF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef coshf
+# define coshf rpl_coshf
+# endif
+_GL_FUNCDECL_RPL (coshf, float, (float x));
+_GL_CXXALIAS_RPL (coshf, float, (float x));
+# else
+# if !@HAVE_COSHF@
+# undef coshf
_GL_FUNCDECL_SYS (coshf, float, (float x));
-# endif
+# endif
_GL_CXXALIAS_SYS (coshf, float, (float x));
+# endif
_GL_CXXALIASWARN (coshf);
#elif defined GNULIB_POSIXCHECK
# undef coshf
-# coshf.m4 serial 2
+# coshf.m4 serial 3
dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
COSHF_LIBM="$COSH_LIBM"
else
HAVE_COSHF=0
+ dnl If the function is declared but does not appear to exist, it may be
+ dnl defined as an inline function. In order to avoid a conflict, we have
+ dnl to define rpl_coshf, not coshf.
+ AC_CHECK_DECLS([coshf], [REPLACE_COSHF=1], , [[#include <math.h>]])
COSHF_LIBM="$COSH_LIBM"
fi
AC_SUBST([COSHF_LIBM])
REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
REPLACE_COSF=0; AC_SUBST([REPLACE_COSF])
+ REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF])
REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
-e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
-e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
-e 's|@''REPLACE_COSF''@|$(REPLACE_COSF)|g' \
+ -e 's|@''REPLACE_COSHF''@|$(REPLACE_COSHF)|g' \
-e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \
-e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \
-e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \