3 # Copyright (C) 2004 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 # Written by Paul Eggert.
21 AC_DEFUN([gl_AC_TYPE_UINT32_T],
23 AC_CACHE_CHECK([for uint32_t], gl_cv_c_uint32_t,
25 for ac_type in "uint32_t" "unsigned int" \
26 "unsigned long int" "unsigned short int"; do
28 [AC_LANG_BOOL_COMPILE_TRY(
29 [AC_INCLUDES_DEFAULT],
30 [[(uint32_t) -1 == 4294967295U]])],
31 [gl_cv_c_uint32_t=$ac_type])
32 test $gl_cv_c_uint32_t != no && break
34 case $gl_cv_c_uint32_t in
37 AC_DEFINE_UNQUOTED(uint32_t, $gl_cv_c_uint32_t,
38 [Define to the type of a unsigned integer type of width exactly 32 bits
39 if such a type exists and the standard includes do not define it.])
43 AC_CACHE_CHECK([for UINT32_MAX], gl_cv_c_uint32_max,
45 [AC_LANG_BOOL_COMPILE_TRY(
46 [AC_INCLUDES_DEFAULT],
47 [[UINT32_MAX == 4294967295U]])],
48 [gl_cv_c_uint32_max=yes],
49 [gl_cv_c_uint32_max=no])])
50 case $gl_cv_c_uint32_max,$gl_cv_c_uint32_t in
54 AC_DEFINE(UINT32_MAX, 4294967295U,
55 [Define to its maximum value if an unsigned integer type of width
56 exactly 32 bits exists and the standard includes do not define