]> Savannah Git Hosting - gnulib.git/commitdiff
logf: Avoid redefinition error on MSVC.
authorBruno Haible <bruno@clisp.org>
Sat, 17 Dec 2016 19:34:06 +0000 (20:34 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 17 Dec 2016 22:09:12 +0000 (23:09 +0100)
* m4/logf.m4 (gl_FUNC_LOGF): Set REPLACE_LOGF to 1 if the function
may be defined as an inline function.

ChangeLog
m4/logf.m4

index 7886bd91a9820ad47821c3752c7da55afaafa8e2..6f95707a7199672145f0f6ce25c2b3f080e8f414 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
index 67935bb86ff31ab6d61756611736d00317750321..abb4fb8328ed64ff9ab92f1a0055ae074e30739d 100644 (file)
@@ -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.