Work around another bug in Ultrix4.3a's /bin/sh.
[coreutils.git] / m4 / uintmax_t.m4
blob4c1d19659b1a8c80214d8ce59c24f82e8f21fab7
1 #serial 1
3 dnl From Paul Eggert.
5 # Define uintmax_t to `unsigned long' or `unsigned long long'
6 # if <inttypes.h> does not exist.
8 AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
10   AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
11   if test $jm_ac_cv_header_inttypes_h = no; then
12     AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
13     [AC_TRY_COMPILE([],
14       [unsigned long long i = (unsigned long long) -1;],
15       ac_cv_type_unsigned_long_long=yes,
16       ac_cv_type_unsigned_long_long=no)])
17     if test $ac_cv_type_unsigned_long_long = yes; then
18       AC_DEFINE(uintmax_t, unsigned long long)
19     else
20       AC_DEFINE(uintmax_t, unsigned long)
21     fi
22   fi