>From c7f934de8352f3051580a022fbb5654c7f8b38b9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 17 Dec 2016 19:49:31 +0100 Subject: [PATCH 10/20] hypotf: Avoid redefinition error on MSVC. * m4/hypotf.m4 (gl_FUNC_HYPOTF): Set REPLACE_HYPOTF to 1 if the function may be defined as an inline function. --- ChangeLog | 6 ++++++ m4/hypotf.m4 | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0fdce80..bc16945 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2016-12-17 Bruno Haible + hypotf: Avoid redefinition error on MSVC. + * m4/hypotf.m4 (gl_FUNC_HYPOTF): Set REPLACE_HYPOTF to 1 if the function + may be defined as an inline function. + +2016-12-17 Bruno Haible + fmodl: Avoid redefinition error on MSVC. * m4/fmodl.m4 (gl_FUNC_FMODL): Set REPLACE_FMODL to 1 if the function may be defined as an inline function. diff --git a/m4/hypotf.m4 b/m4/hypotf.m4 index a7c7f40..ebee6d9 100644 --- a/m4/hypotf.m4 +++ b/m4/hypotf.m4 @@ -1,4 +1,4 @@ -# hypotf.m4 serial 4 +# hypotf.m4 serial 5 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, @@ -21,6 +21,7 @@ AC_DEFUN([gl_FUNC_HYPOTF], LIBS="$save_LIBS" if test $ac_cv_func_hypotf = yes; then HYPOTF_LIBM="$HYPOT_LIBM" + save_LIBS="$LIBS" LIBS="$LIBS $HYPOTF_LIBM" gl_FUNC_HYPOTF_WORKS @@ -29,6 +30,7 @@ AC_DEFUN([gl_FUNC_HYPOTF], *yes) ;; *) REPLACE_HYPOTF=1 ;; esac + m4_ifdef([gl_FUNC_HYPOTF_IEEE], [ if test $gl_hypotf_required = ieee && test $REPLACE_HYPOTF = 0; then AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles @@ -85,6 +87,10 @@ int main (int argc, char *argv[]) ]) else HAVE_HYPOTF=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_hypotf, not hypotf. + AC_CHECK_DECLS([hypotf], [REPLACE_HYPOTF=1], , [[#include ]]) fi if test $HAVE_HYPOTF = 0 || test $REPLACE_HYPOTF = 1; then dnl Find libraries needed to link lib/hypotf.c. -- 2.6.4