]> Savannah Git Hosting - gnulib.git/commitdiff
hypotl: Avoid redefinition error on MSVC.
authorBruno Haible <bruno@clisp.org>
Sat, 17 Dec 2016 18:51:29 +0000 (19:51 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 17 Dec 2016 22:09:10 +0000 (23:09 +0100)
* m4/hypotl.m4 (gl_FUNC_HYPOTL): Set REPLACE_HYPOTL to 1 if the function
may be defined as an inline function.

ChangeLog
m4/hypotl.m4

index bc16945b0d54fef8a5397afb63ccccfee5038844..963f4539ab3b34696af3f9e00a1ee36337a0ab82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-12-17  Bruno Haible  <bruno@clisp.org>
+
+       hypotl: Avoid redefinition error on MSVC.
+       * m4/hypotl.m4 (gl_FUNC_HYPOTL): Set REPLACE_HYPOTL to 1 if the function
+       may be defined as an inline function.
+
 2016-12-17  Bruno Haible  <bruno@clisp.org>
 
        hypotf: Avoid redefinition error on MSVC.
index d972acf353f1cbccebbfe71d951b80ec68e80c5f..e756329f4f9966aa360692d07da7cd625b778cf6 100644 (file)
@@ -1,4 +1,4 @@
-# hypotl.m4 serial 5
+# hypotl.m4 serial 6
 dnl Copyright (C) 2012-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,
@@ -87,6 +87,10 @@ int main (int argc, char *argv[])
     ])
   else
     HAVE_HYPOTL=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_hypotl, not hypotl.
+    AC_CHECK_DECLS([hypotl], [REPLACE_HYPOTL=1], , [[#include <math.h>]])
   fi
   if test $HAVE_HYPOTL = 0 || test $REPLACE_HYPOTL = 1; then
     dnl Find libraries needed to link lib/hypotl.c.