Use an all-permissive copyright notice, recommended by RMS.
[pspp] / m4 / uint32_t.m4
1 # uint32_t.m4 serial 3
2
3 # Copyright (C) 2004 Free Software Foundation, Inc.
4
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)
8 # any later version.
9
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.
14
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.
18
19 # Written by Paul Eggert.
20
21 AC_DEFUN([gl_AC_TYPE_UINT32_T],
22 [
23   AC_CACHE_CHECK([for uint32_t], gl_cv_c_uint32_t,
24     [gl_cv_c_uint32_t=no
25      for ac_type in "uint32_t" "unsigned int" \
26          "unsigned long int" "unsigned short int"; do
27        AC_COMPILE_IFELSE(
28          [AC_LANG_BOOL_COMPILE_TRY(
29             [AC_INCLUDES_DEFAULT],
30             [[($ac_type) -1 == 4294967295U]])],
31          [gl_cv_c_uint32_t=$ac_type])
32        test "$gl_cv_c_uint32_t" != no && break
33      done])
34   case "$gl_cv_c_uint32_t" in
35   no|uint32_t) ;;
36   *)
37     AC_DEFINE(_UINT32_T, 1,
38       [Define for Solaris 2.5.1 so uint32_t typedef from <sys/synch.h>,
39        <pthread.h>, or <semaphore.h> is not used. If the typedef was
40        allowed, the #define below would cause a syntax error.])
41     AC_DEFINE_UNQUOTED(uint32_t, $gl_cv_c_uint32_t,
42       [Define to the type of a unsigned integer type of width exactly 32 bits
43        if such a type exists and the standard includes do not define it.])
44     ;;
45   esac
46
47   AC_CACHE_CHECK([for UINT32_MAX], gl_cv_c_uint32_max,
48     [AC_COMPILE_IFELSE(
49        [AC_LANG_BOOL_COMPILE_TRY(
50           [AC_INCLUDES_DEFAULT],
51           [[UINT32_MAX == 4294967295U]])],
52        [gl_cv_c_uint32_max=yes],
53        [gl_cv_c_uint32_max=no])])
54   case $gl_cv_c_uint32_max,$gl_cv_c_uint32_t in
55   yes,*) ;;
56   *,no) ;;
57   *)
58     AC_DEFINE(UINT32_MAX, 4294967295U,
59       [Define to its maximum value if an unsigned integer type of width
60        exactly 32 bits exists and the standard includes do not define
61        UINT32_MAX.])
62     ;;
63   esac
64 ])