summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2016-12-17 20:34:06 +0100
committerBruno Haible <bruno@clisp.org>2016-12-17 23:09:12 +0100
commit33b84df8e31cd2e2c9058c3ff935e3ddfc8e01d0 (patch)
tree52c74f3eb4eeca9741bf26ec5647c8852e748b68
parentef458c87188265ccd056376432f4a84ad4e965ad (diff)
downloadgnulib-33b84df8e31cd2e2c9058c3ff935e3ddfc8e01d0.tar.gz
logf: Avoid redefinition error on MSVC.
* m4/logf.m4 (gl_FUNC_LOGF): Set REPLACE_LOGF to 1 if the function may be defined as an inline function.
-rw-r--r--ChangeLog6
-rw-r--r--m4/logf.m46
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7886bd91a9..6f95707a71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2016-12-17 Bruno Haible <bruno@clisp.org>
+ logf: Avoid redefinition error on MSVC.
+ * m4/logf.m4 (gl_FUNC_LOGF): Set REPLACE_LOGF to 1 if the function
+ may be defined as an inline function.
+
+2016-12-17 Bruno Haible <bruno@clisp.org>
+
log10l: Avoid redefinition error on MSVC.
* m4/log10l.m4 (gl_FUNC_LOG10L): Set REPLACE_LOG10L to 1 if the function
may be defined as an inline function.
diff --git a/m4/logf.m4 b/m4/logf.m4
index 67935bb86f..abb4fb8328 100644
--- a/m4/logf.m4
+++ b/m4/logf.m4
@@ -1,4 +1,4 @@
-# logf.m4 serial 6
+# logf.m4 serial 7
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,
@@ -84,6 +84,10 @@ int main (int argc, char *argv[])
])
else
HAVE_LOGF=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_logf, not logf.
+ AC_CHECK_DECLS([logf], [REPLACE_LOGF=1], , [[#include <math.h>]])
fi
if test $HAVE_LOGF = 0 || test $REPLACE_LOGF = 1; then
dnl Find libraries needed to link lib/logf.c.