X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Ftruncf.m4;h=346f0c8bb19d4c7388955bcbdb1a73c6b0a5bfb2;hb=d48d7d9132b633a3a31a2f6f131ce7033f1faf8d;hp=3920fcd469e75e60a6fce7e39ca33540341651f2;hpb=7d47ca399ea9ea4986d9166434bdbd77ed8ed8e9;p=gnulib.git diff --git a/m4/truncf.m4 b/m4/truncf.m4 index 3920fcd46..346f0c8bb 100644 --- a/m4/truncf.m4 +++ b/m4/truncf.m4 @@ -1,4 +1,4 @@ -# truncf.m4 serial 5 +# truncf.m4 serial 8 dnl Copyright (C) 2007, 2010-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, @@ -11,7 +11,7 @@ AC_DEFUN([gl_FUNC_TRUNCF], dnl Persuade glibc to declare truncf(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) dnl Test whether truncf() is declared. - AC_CHECK_DECLS([truncf], , , [#include ]) + AC_CHECK_DECLS([truncf], , , [[#include ]]) if test "$ac_cv_have_decl_truncf" = yes; then dnl Test whether truncf() can be used without libm. TRUNCF_LIBM=? @@ -56,10 +56,12 @@ AC_DEFUN([gl_FUNC_TRUNCF], #include ]gl_FLOAT_MINUS_ZERO_CODE[ ]gl_FLOAT_SIGNBIT_CODE[ -int main() +static float dummy (float f) { return 0; } +int main (int argc, char *argv[]) { + float (*my_truncf) (float) = argc ? truncf : dummy; /* Test whether truncf (-0.0f) is -0.0f. */ - if (signbitf (minus_zerof) && !signbitf (truncf (minus_zerof))) + if (signbitf (minus_zerof) && !signbitf (my_truncf (minus_zerof))) return 1; return 0; }