summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-12-02 17:44:04 +0000
committerJim Meyering <jim@meyering.net>2000-12-02 17:44:04 +0000
commit0d849addb325f581692679899434a924b661e0c1 (patch)
tree4778fd6e21e7833d42687c2624ce8c9a55632031 /m4
parent1698b850908eaa71c363cf5cd8a720649fd6dffc (diff)
downloadcoreutils-0d849addb325f581692679899434a924b661e0c1.tar.xz
*** empty log message ***
Diffstat (limited to 'm4')
-rw-r--r--m4/off_t-format.m449
1 files changed, 24 insertions, 25 deletions
diff --git a/m4/off_t-format.m4 b/m4/off_t-format.m4
index 0b3f153b9..7eba1d371 100644
--- a/m4/off_t-format.m4
+++ b/m4/off_t-format.m4
@@ -7,35 +7,34 @@ AC_DEFUN(jm_SYS_OFF_T_PRINTF_FORMAT,
AC_CACHE_CHECK([for printf format that works with type off_t],
jm_cv_sys_off_t_printf_format,
[
- for i in '' L ll q; do
- jm_OFF_T_FORMAT="$i"
+ for jm_fmt in '' L ll q; do
+ jm_OFF_T_FORMAT="$jm_fmt"
export jm_OFF_T_FORMAT
AC_TRY_RUN([
-# include <sys/types.h>
-# include <stdio.h>
-# if HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-# if HAVE_STRING_H
-# include <string.h>
-# endif
- int
- main()
- {
- char buf[50];
- static off_t x[] = {1, 255, 65535, 99999999};
- char fmt[50];
+# include <sys/types.h>
+# include <stdio.h>
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+# if HAVE_STRING_H
+# include <string.h>
+# endif
+ int
+ main()
+ {
+ static off_t x[] = {1, 255, 65535, 99999999};
+ char buf[50], fmt[50];
- /* this envvar should have one of these values: "", "L", "ll", "q" */
- char *f = getenv ("jm_OFF_T_FORMAT");
- sprintf (fmt, "%%%sd %%%sx %%%sx %%%sd", f, f, f, f);
+ /* this should be one of these values: "", "L", "ll", "q" */
+ char *f = getenv ("jm_OFF_T_FORMAT");
- sprintf (buf, fmt, x[0], x[1], x[2], x[3]);
- exit (strcmp (buf, "1 ff ffff 99999999"));
- }
- ], jm_cv_sys_off_t_printf_format=yes dnl The library version works.
- , jm_cv_sys_off_t_printf_format=no dnl The library version does NOT work.
- , jm_cv_sys_off_t_printf_format=no dnl We're cross compiling.
+ sprintf (fmt, "%%%sd %%%sx %%%sx %%%sd", f, f, f, f);
+ sprintf (buf, fmt, x[0], x[1], x[2], x[3]);
+ exit (strcmp (buf, "1 ff ffff 99999999"));
+ }
+ ], jm_cv_sys_off_t_printf_format=$jm_fmt; break
+ , jm_cv_sys_off_t_printf_format=no dnl The library version does NOT work.
+ , jm_cv_sys_off_t_printf_format=no dnl We're cross compiling.
)
done
])