-# round.m4 serial 10
+# round.m4 serial 13
dnl Copyright (C) 2007, 2009-2011 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_MATH_H_DEFAULTS])
dnl Persuade glibc <math.h> to declare round().
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_DECLS([round], , , [#include <math.h>])
+ AC_CHECK_DECLS([round], , , [[#include <math.h>]])
if test "$ac_cv_have_decl_round" = yes; then
gl_CHECK_MATH_LIB([ROUND_LIBM], [x = round (x);])
if test "$ROUND_LIBM" != missing; then
#include <math.h>
]gl_DOUBLE_MINUS_ZERO_CODE[
]gl_DOUBLE_SIGNBIT_CODE[
-int main()
+static double dummy (double f) { return 0; }
+int main (int argc, char *argv[])
{
+ double (*my_round) (double) = argc ? round : dummy;
/* Test whether round (-0.0) is -0.0. */
- if (signbitd (minus_zerod) && !signbitd (round (minus_zerod)))
+ if (signbitd (minus_zerod) && !signbitd (my_round (minus_zerod)))
return 1;
return 0;
}
HAVE_DECL_ROUND=0
fi
if test $HAVE_DECL_ROUND = 0 || test $REPLACE_ROUND = 1; then
- AC_LIBOBJ([round])
+ dnl Find libraries needed to link lib/round.c.
gl_FUNC_FLOOR_LIBS
gl_FUNC_CEIL_LIBS
ROUND_LIBM=