summaryrefslogtreecommitdiff
path: root/m4/cosf.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2016-12-17 19:31:58 +0100
committerBruno Haible <bruno@clisp.org>2016-12-17 23:09:04 +0100
commit9113a6db3f4efd150bfa77188e1277ff83aadc1b (patch)
treeedde8e063e4d9a79cced1dbf4deff63834520740 /m4/cosf.m4
parentcf308efdb00585d5e7139c0e6eff3ad4854769a1 (diff)
downloadgnulib-9113a6db3f4efd150bfa77188e1277ff83aadc1b.tar.gz
cosf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_COSF. * m4/cosf.m4 (gl_FUNC_COSF): Set REPLACE_COSF to 1 if the function may be defined as an inline function. * modules/math (Makefile.am): Substitute REPLACE_COSF. * lib/math.in.h (cosf): Override if REPLACE_COSF is 1.
Diffstat (limited to 'm4/cosf.m4')
-rw-r--r--m4/cosf.m46
1 files changed, 5 insertions, 1 deletions
diff --git a/m4/cosf.m4 b/m4/cosf.m4
index 8315aa0110..757d9b7238 100644
--- a/m4/cosf.m4
+++ b/m4/cosf.m4
@@ -1,4 +1,4 @@
-# cosf.m4 serial 2
+# cosf.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,
@@ -22,6 +22,10 @@ AC_DEFUN([gl_FUNC_COSF],
COSF_LIBM="$COS_LIBM"
else
HAVE_COSF=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_cosf, not cosf.
+ AC_CHECK_DECLS([cosf], [REPLACE_COSF=1], , [[#include <math.h>]])
COSF_LIBM="$COS_LIBM"
fi
AC_SUBST([COSF_LIBM])