-# fmal.m4 serial 2
+# fmal.m4 serial 3
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,
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
dnl Determine FMAL_LIBM.
- gl_MATHFUNC([fmal], [long double], [(long double, long double, long double)])
+ gl_MATHFUNC([fmal], [long double], [(long double, long double, long double)],
+ [extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ long double fmal (long double, long double, long double);
+ ])
if test $gl_cv_func_fmal_no_libm = yes \
|| test $gl_cv_func_fmal_in_libm = yes; then
- gl_FUNC_FMAL_WORKS
- case "$gl_cv_func_fmal_works" in
- *no) REPLACE_FMAL=1 ;;
- esac
+ dnl Also check whether it's declared.
+ dnl IRIX 6.5 has fmal() in libm but doesn't declare it in <math.h>,
+ dnl and the function is buggy.
+ AC_CHECK_DECL([fmal], , [REPLACE_FMAL=1], [[#include <math.h>]])
+ if test $REPLACE_FMAL = 0; then
+ gl_FUNC_FMAL_WORKS
+ case "$gl_cv_func_fmal_works" in
+ *no) REPLACE_FMAL=1 ;;
+ esac
+ fi
else
HAVE_FMAL=0
fi