1184588Sdfr# uintmax_t.m4 serial 7 (gettext-0.12)
2184588Sdfrdnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3184588Sdfrdnl This file is free software, distributed under the terms of the GNU
4184588Sdfrdnl General Public License.  As a special exception to the GNU General
5184588Sdfrdnl Public License, this file may be distributed as part of a program
6184588Sdfrdnl that contains a configuration script generated by Autoconf, under
7184588Sdfrdnl the same distribution terms as the rest of that program.
8184588Sdfr
9184588Sdfrdnl From Paul Eggert.
10184588Sdfr
11184588SdfrAC_PREREQ(2.13)
12184588Sdfr
13184588Sdfr# Define uintmax_t to 'unsigned long' or 'unsigned long long'
14184588Sdfr# if it is not already defined in <stdint.h> or <inttypes.h>.
15184588Sdfr
16184588SdfrAC_DEFUN([jm_AC_TYPE_UINTMAX_T],
17184588Sdfr[
18184588Sdfr  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
19184588Sdfr  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
20184588Sdfr  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
21184588Sdfr    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
22184588Sdfr    test $ac_cv_type_unsigned_long_long = yes \
23184588Sdfr      && ac_type='unsigned long long' \
24184588Sdfr      || ac_type='unsigned long'
25184588Sdfr    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
26184588Sdfr      [Define to unsigned long or unsigned long long
27184588Sdfr       if <stdint.h> and <inttypes.h> don't define.])
28184588Sdfr  else
29184588Sdfr    AC_DEFINE(HAVE_UINTMAX_T, 1,
30184588Sdfr      [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
31184588Sdfr  fi
32184588Sdfr])
33184588Sdfr