type _Bool.
Fix a typo.
* doc/autoconf.texi (Particular Headers): Adjust according to Paul
Eggert's recommandations.
+2002-10-23 Akim Demaille <akim@epita.fr>
+
+ * lib/autoconf/headers.m4 (AC_HEADER_STDBOOL): Also look for the
+ type _Bool.
+ Fix a typo.
+ * doc/autoconf.texi (Particular Headers): Adjust according to Paul
+ Eggert's recommandations.
+
2002-10-22 Akim Demaille <akim@epita.fr>
* lib/autoconf/headers.m4 (AC_HEADER_STDBOOL): New, based on CVS
@acindex HEADER_STDBOOL
@cvindex HAVE_STDBOOL_H
If @file{stdbool.h} exists and is conformant to C99, define
-@code{HAVE_STDBOOL_H} to 1. Your @file{system.h} should contain the
-following code:
+@code{HAVE_STDBOOL_H} to 1. To fulfill the C99 requirements, your
+@file{system.h} should contain the following code:
@verbatim
#if HAVE_STDBOOL_H
# include <stdbool.h>
#else
-typedef enum {false = 0, true = 1} bool;
+# if ! HAVE__BOOL
+# ifdef __cplusplus
+typedef bool _Bool;
+# else
+typedef unsigned char _Bool;
+# endif
+# endif
+# define bool _Bool
+# define false 0
+# define true 1
+# define __bool_true_false_are_defined 1
#endif
@end verbatim
@end defmac
# error false is not 0
#endif
#ifndef true
-# error false is not defined
+# error true is not defined
#endif
#if true != 1
# error true is not 1
[[ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ]])],
[ac_cv_header_stdbool_h=yes],
[ac_cv_header_stdbool_h=no])])
+AC_CHECK_TYPES([_Bool])
if test $ac_cv_header_stdbool_h = yes; then
AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
fi