~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to m4/intmax_t.m4

  • Committer: Arnold D. Robbins
  • Date: 2010-07-16 11:47:02 UTC
  • Revision ID: git-v1:315bd501ca696bc3e3c938b4604d8dac7a6f512f
Tags: gawk-3.1.5
Move to gawk 3.1.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
# Define intmax_t to long or long long if <inttypes.h> doesn't define.
8
8
 
9
 
AC_DEFUN([jm_AC_TYPE_INTMAX_T],
 
9
AC_DEFUN([gl_AC_TYPE_INTMAX_T],
10
10
[
11
 
  AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
12
 
  AC_CHECK_TYPE(intmax_t, ,
13
 
    [test $ac_cv_type_long_long = yes \
14
 
       && ac_type='long long' \
15
 
       || ac_type='long'
16
 
     AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
17
 
       [Define to widest signed type if <inttypes.h> doesn't define.])])
 
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
18
26
])
19
27
 
20
28
# Define uintmax_t to unsigned long or unsigned long long