summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-08-25 15:17:22 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-08-25 15:17:22 +0000
commit79272f68f2cbd2b29c5e606a721fed0028a180c3 (patch)
tree5e192a5bc844da0352cb1f383d62e6ff95b57283
parent547b049440ae5a9b09e689c9e6545d9f566c1107 (diff)
downloadmpfr-79272f68f2cbd2b29c5e606a721fed0028a180c3.tar.gz
[acinclude.m4] Check whether the 'j' printf length modifier is working.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9659 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--acinclude.m419
1 files changed, 19 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 8653e9cce..91131273a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -164,6 +164,25 @@ if test "$ac_cv_type_intmax_t" = yes; then
if test "$mpfr_cv_have_intmax_max" = "yes"; then
AC_DEFINE(MPFR_HAVE_INTMAX_MAX,1,[Define if you have a working INTMAX_MAX.])
fi
+ AC_CACHE_CHECK([for working 'j' printf length modifier],
+ mpfr_cv_have_printf_j, [
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$srcdir/src"
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <string.h>
+#include "mpfr-intmax.h"
+]],[[
+ char s[64];
+ sprintf (s, "%jd %ju", (intmax_t) -17, (uintmax_t) 42);
+ return strcmp (s, "-17 42") != 0;
+]])],
+ mpfr_cv_have_printf_j=yes, mpfr_cv_have_printf_j=no)
+ CPPFLAGS="$saved_CPPFLAGS"
+ ])
+ if test "$mpfr_cv_have_printf_j" = "yes"; then
+ AC_DEFINE(MPFR_HAVE_PRINTF_J,1,
+ [Define if you have a working 'j' printf length modifier])
+ fi
fi
AC_CHECK_TYPE( [union fpc_csr],