]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/headers.m4 (AC_HEADER_STDBOOL): Also look for the
authorAkim Demaille <akim@epita.fr>
Wed, 23 Oct 2002 07:27:03 +0000 (07:27 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 23 Oct 2002 07:27:03 +0000 (07:27 +0000)
type _Bool.
Fix a typo.
* doc/autoconf.texi (Particular Headers): Adjust according to Paul
Eggert's recommandations.

ChangeLog
doc/autoconf.texi
lib/autoconf/headers.m4

index 4ece9a9c1acc196369db8683dfaf024a56cdd293..cf2b99ae8de78f013ea4991892b55529854c437c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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
index 853692314c3a47facef6c124a5bc219d8c60b3cd..81dff1c1ac1345cc28ddbfad98705b5573ed2bea 100644 (file)
@@ -4285,14 +4285,24 @@ Amdahl UTS and Motorola System V/88.
 @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
index dcdf7efb7b747a589737ca550fc806f48a7c700d..c3cf5ef2cc4962f449903fa4af8df06d3c053b61 100644 (file)
@@ -509,7 +509,7 @@ AC_DEFUN([AC_HEADER_STDBOOL],
 # 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
@@ -533,6 +533,7 @@ AC_DEFUN([AC_HEADER_STDBOOL],
       [[ 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