1 |
# Check for stdbool.h that conforms to C99. |
# Check for stdbool.h that conforms to C99. |
2 |
|
|
3 |
dnl Copyright (C) 2002-2004 Free Software Foundation, Inc. |
dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. |
4 |
dnl This file is free software; the Free Software Foundation |
dnl This file is free software; the Free Software Foundation |
5 |
dnl gives unlimited permission to copy and/or distribute it, |
dnl gives unlimited permission to copy and/or distribute it, |
6 |
dnl with or without modifications, as long as this notice is preserved. |
dnl with or without modifications, as long as this notice is preserved. |
28 |
AC_SUBST([HAVE__BOOL]) |
AC_SUBST([HAVE__BOOL]) |
29 |
]) |
]) |
30 |
|
|
31 |
|
# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future. |
32 |
|
AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) |
33 |
|
|
34 |
# This macro is only needed in autoconf <= 2.59. Newer versions of autoconf |
# This macro is only needed in autoconf <= 2.59. Newer versions of autoconf |
35 |
# have this macro built-in. |
# have this macro built-in. |
36 |
|
|
73 |
enum { j = false, k = true, l = false * true, m = true * 256 }; |
enum { j = false, k = true, l = false * true, m = true * 256 }; |
74 |
_Bool n[m]; |
_Bool n[m]; |
75 |
char o[sizeof n == m * sizeof n[0] ? 1 : -1]; |
char o[sizeof n == m * sizeof n[0] ? 1 : -1]; |
76 |
|
char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; |
77 |
], |
], |
78 |
[ |
[ |
79 |
return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + !l |
/* Refer to every declared value, to avoid compiler optimizations. */ |
80 |
+ !m + !n + !o); |
return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l |
81 |
|
+ !m + !n + !o + !p); |
82 |
], |
], |
83 |
[ac_cv_header_stdbool_h=yes], |
[ac_cv_header_stdbool_h=yes], |
84 |
[ac_cv_header_stdbool_h=no])]) |
[ac_cv_header_stdbool_h=no])]) |