Debian Codegraph @

m4/intmax_t.m4

raw
1 #serial 6
2
3 dnl From Paul Eggert.
4
5 AC_PREREQ(2.52)
6
7 # Define intmax_t to long or long long if <inttypes.h> doesn't define.
8
9 AC_DEFUN([gl_AC_TYPE_INTMAX_T],
10 [
11 dnl For simplicity, we assume that a header file defines 'intmax_t' if and
12 dnl only if it defines 'uintmax_t'.
13 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
14 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
15 if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
16 AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
17 test $ac_cv_type_long_long = yes \
18 && ac_type='long long' \
19 || ac_type='long'
20 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
21 [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
22 else
23 AC_DEFINE(HAVE_INTMAX_T, 1,
24 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
25 fi
26 ])
27
28 # Define uintmax_t to unsigned long or unsigned long long
29 # if <inttypes.h> doesn't define.
30
31 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
32 [
33 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
34 AC_CHECK_TYPE(uintmax_t, ,
35 [test $ac_cv_type_unsigned_long_long = yes \
36 && ac_type='unsigned long long' \
37 || ac_type='unsigned long'
38 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
39 [Define to widest unsigned type if <inttypes.h> doesn't define.])])
40 ])