1 #serial 1 -*- autoconf -*-
4 AC_DEFUN(jm_SYS_OFF_T_PRINTF_FORMAT,
6 AC_CHECK_HEADERS(string.h stdlinb.h)
7 AC_CACHE_CHECK([for printf format that works with type off_t],
8 jm_cv_sys_off_t_printf_format,
10 for jm_fmt in '' L ll q; do
11 jm_OFF_T_FORMAT="$jm_fmt"
12 export jm_OFF_T_FORMAT
14 # include <sys/types.h>
25 static off_t x[] = {1, 255, 65535, 99999999};
26 char buf[50], fmt[50];
28 /* this should be one of these values: "", "L", "ll", "q" */
29 char *f = getenv ("jm_OFF_T_FORMAT");
31 sprintf (fmt, "%%%sd %%%sx %%%sx %%%sd", f, f, f, f);
32 sprintf (buf, fmt, x[0], x[1], x[2], x[3]);
33 exit (strcmp (buf, "1 ff ffff 99999999"));
35 ], jm_cv_sys_off_t_printf_format=$jm_fmt; break
36 , jm_cv_sys_off_t_printf_format=no dnl The library version does NOT work.
37 , jm_cv_sys_off_t_printf_format=no dnl We're cross compiling.
43 if test $am_cv_func_working_getline = no; then