summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-07-01 00:10:23 +0100
committerPádraig Brady <P@draigBrady.com>2015-07-01 12:29:59 +0100
commit81c7fc4081df7cb59b55c5fde486687afd0c87d7 (patch)
treee6b010d117714b355e60e9eb1425c2558aef6568 /m4
parent491f54fb5a9d52b5f42f4a946094f7919da2966f (diff)
downloadcoreutils-81c7fc4081df7cb59b55c5fde486687afd0c87d7.tar.gz
numfmt: increase precision on 32 bit FreeBSD
* m4/jm-macros.m4 (HAVE_FPSETPREC): Define if needed. * src/numfmt.c (main): Call fpsetprec() if needed. Fixes large-15 and large-16 test failures on 32 bit FreeBSD.
Diffstat (limited to 'm4')
-rw-r--r--m4/jm-macros.m415
1 files changed, 15 insertions, 0 deletions
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4
index 79f124b01..51c533a42 100644
--- a/m4/jm-macros.m4
+++ b/m4/jm-macros.m4
@@ -165,6 +165,21 @@ AC_DEFUN([coreutils_MACROS],
LIBS="$ac_seq_save_LIBS"
])
+
+ # See is fpsetprec() required to use extended double precision
+ # This is needed on 32 bit FreeBSD to give accurate conversion of:
+ # `numfmt 9223372036854775808`
+ AC_TRY_LINK([#include <ieeefp.h>],
+ [#ifdef __i386__
+ fpsetprec(FP_PE);
+ #else
+ # error not required on 64 bit
+ #endif
+ ], [ac_have_fpsetprec=yes], [ac_have_fpsetprec=no])
+ if test "$ac_have_fpsetprec" = "yes" ; then
+ AC_DEFINE([HAVE_FPSETPREC], 1, [whether fpsetprec is present and required])
+ fi
+
AC_REQUIRE([AM_LANGINFO_CODESET])
# Accept configure options: --with-tty-group[=GROUP], --without-tty-group