* 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.
This commit is contained in:
Akim Demaille 2002-10-23 07:27:03 +00:00
parent 86c6702369
commit 38999f6a79
3 changed files with 23 additions and 4 deletions

View File

@ -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

View 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

View 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