X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fround.m4;h=e2acf936695ff0721d8a98ebc97ef77018ae3675;hb=a0dccde75e6a3b9c930e3577fae7a5bf9351ec09;hp=5f19c5aa68c9fee46db4be7191cb9cbd8686b869;hpb=9b144e908f361bc95b309fd33bfa0bc09ae55cc7;p=gnulib.git diff --git a/m4/round.m4 b/m4/round.m4 index 5f19c5aa6..e2acf9366 100644 --- a/m4/round.m4 +++ b/m4/round.m4 @@ -1,5 +1,5 @@ -# round.m4 serial 10 -dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. +# round.m4 serial 14 +dnl Copyright (C) 2007, 2009-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. @@ -10,7 +10,7 @@ AC_DEFUN([gl_FUNC_ROUND], AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Persuade glibc to declare round(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - AC_CHECK_DECLS([round], , , [#include ]) + AC_CHECK_DECLS([round], , , [[#include ]]) if test "$ac_cv_have_decl_round" = yes; then gl_CHECK_MATH_LIB([ROUND_LIBM], [x = round (x);]) if test "$ROUND_LIBM" != missing; then @@ -25,6 +25,9 @@ AC_DEFUN([gl_FUNC_ROUND], AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include +#ifdef _MSC_VER +# pragma fenv_access (off) +#endif int main() { /* 2^DBL_MANT_DIG. */ @@ -69,10 +72,12 @@ int main() #include ]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; } @@ -92,7 +97,7 @@ int main() 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=