From 79272f68f2cbd2b29c5e606a721fed0028a180c3 Mon Sep 17 00:00:00 2001 From: vlefevre Date: Tue, 25 Aug 2015 15:17:22 +0000 Subject: [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 --- acinclude.m4 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 +#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], -- cgit v1.2.1