Start using the bool type
Hrvoje Niksic <[email protected]> Wed, 22 Jun 2005 19:51:06 +0200
| Newsgroups | gmane.comp.web.wget.patches |
|---|---|
| Message-ID | <[email protected]> |
This adds the bool type compatible with the C99 one, or uses it if found. The sources will soon be converted to use this type consistently. ChangeLog: 2005-06-22 Hrvoje Niksic <[email protected]> * configure.in: Check for C99 conformant stdbool.h. src/ChangeLog: 2005-06-22 Hrvoje Niksic <[email protected]> * sysdep.h: Include the stdbool.h/_Bool/bool blurb from Autoconf. Index: configure.in =================================================================== --- configure.in (revision 1743) +++ configure.in (working copy) @@ -162,6 +162,7 @@ dnl This is because Autoconf default includes check for STDC_HEADERS, dnl HAVE_SYS_TYPES_H, etc. before including them. AC_HEADER_STDC +AC_HEADER_STDBOOL AC_CHECK_HEADERS(sys/types.h sys/stat.h) dnl Now check for the others. AC_CHECK_HEADERS(string.h strings.h limits.h unistd.h sys/time.h) Index: src/sysdep.h =================================================================== --- src/sysdep.h (revision 1743) +++ src/sysdep.h (working copy) @@ -63,6 +63,24 @@ # include <io.h> #endif /* __WATCOMC__ */ +/* Provide support for C99-type boolean type "bool". This blurb comes + straight from the Autoconf 2.59 manual. */ +#if HAVE_STDBOOL_H +# include <stdbool.h> +#else +# 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 + /* Needed for compilation under OS/2: */ #ifdef __EMX__ # ifndef S_ISLNK