X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=m4%2Ffma.m4;h=2ecdd8a4d4a46f3f76634090ca4ca32450c4234e;hb=639607db00b96f33b0e18afa27188456c6ccad0a;hp=3ce3f9a05c2fdbc2ec79a449c382924905e20608;hpb=cebba9faecfecedf8378a06f46823166e3b4374a;p=gnulib.git diff --git a/m4/fma.m4 b/m4/fma.m4 index 3ce3f9a05..2ecdd8a4d 100644 --- a/m4/fma.m4 +++ b/m4/fma.m4 @@ -1,5 +1,5 @@ -# fma.m4 serial 1 -dnl Copyright (C) 2011 Free Software Foundation, Inc. +# fma.m4 serial 2 +dnl Copyright (C) 2011-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,13 +9,25 @@ AC_DEFUN([gl_FUNC_FMA], AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Determine FMA_LIBM. - gl_MATHFUNC([fma], [double], [(double, double, double)]) + gl_MATHFUNC([fma], [double], [(double, double, double)], + [extern + #ifdef __cplusplus + "C" + #endif + double fma (double, double, double); + ]) if test $gl_cv_func_fma_no_libm = yes \ || test $gl_cv_func_fma_in_libm = yes; then - gl_FUNC_FMA_WORKS - case "$gl_cv_func_fma_works" in - *no) REPLACE_FMA=1 ;; - esac + dnl Also check whether it's declared. + dnl IRIX 6.5 has fma() in libm but doesn't declare it in , + dnl and the function is buggy. + AC_CHECK_DECL([fma], , [REPLACE_FMA=1], [[#include ]]) + if test $REPLACE_FMA = 0; then + gl_FUNC_FMA_WORKS + case "$gl_cv_func_fma_works" in + *no) REPLACE_FMA=1 ;; + esac + fi else HAVE_FMA=0 fi