From 39ee80d53f41b05ef1f483363e8e535db8137f90 Mon Sep 17 00:00:00 2001 From: Zev Weiss Date: Sun, 16 Oct 2016 01:14:51 -0500 Subject: grep: use 'j' intmax_t printf length modifier if supported * configure.ac: Use gl_PRINTF_SIZES_C99 to test printf and (conditionally) define HAVE_PRINTF_C99_SIZES. * src/grep.c (print_offset): Use printf("%j...") for printing [u]intmax_t if HAVE_PRINTF_C99_SIZES is defined; otherwise continue using the existing hand-rolled loop. --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 8a20317e..0dd4d849 100644 --- a/configure.ac +++ b/configure.ac @@ -206,6 +206,12 @@ fi gl_FUNC_PCRE +gl_PRINTF_SIZES_C99 +if test "$gl_cv_func_printf_sizes_c99" = yes; then + AC_DEFINE([HAVE_PRINTF_C99_SIZES], [1], + [Define to 1 if printf formats %j, %z, %t and %L work.]) +fi + case $host_os in mingw*) suffix=w32 ;; *) suffix=posix ;; -- cgit v1.2.1