Fix checking for round()

Old check fails on current GCC/glibc with
"error: statement cannot resolve address of overloaded function"
This commit is contained in:
Paul Cornett
2018-09-21 08:25:31 -07:00
parent fa1af3405c
commit 99565d0619
2 changed files with 28 additions and 44 deletions

View File

@@ -4193,9 +4193,17 @@ fi
dnl at least under IRIX with mipsPro the C99 round() function is available when
dnl building using the C compiler but not when using C++ one
AC_CACHE_CHECK([for round], wx_cv_func_round, [
AC_LANG_PUSH(C++)
WX_CHECK_FUNCS(round,,,[#include <math.h>])
AC_TRY_LINK(
[#include <math.h>],
[return int(round(0.0))],
wx_cv_func_round=yes, wx_cv_func_round=no)
AC_LANG_POP()
])
if test "$wx_cv_func_round" = yes; then
AC_DEFINE(HAVE_ROUND)
fi
dnl the following tests are for Unix(like) systems only
if test "$TOOLKIT" != "MSW"; then