From: hniksic Date: Wed, 22 Jun 2005 17:51:29 +0000 (-0700) Subject: [svn] Check for the C99 bool type and define it if missing. X-Git-Tag: v1.13~955 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=19a1ffb2e9c0ed511ab63033ab515b7332a8925e [svn] Check for the C99 bool type and define it if missing. --- diff --git a/ChangeLog b/ChangeLog index 3bb1f563..07758b68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-06-22 Hrvoje Niksic + + * configure.in: Check for C99 conformant stdbool.h. + 2005-06-22 Hrvoje Niksic * MAILING-LIST: Remove reference to the obsolete `wget-cvs' diff --git a/configure.in b/configure.in index 1ea9f10e..a38a3607 100644 --- a/configure.in +++ b/configure.in @@ -162,6 +162,7 @@ dnl Check for basic headers, even those we assume the presence of. 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) diff --git a/src/ChangeLog b/src/ChangeLog index 084310f7..dd1c0ac5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-06-22 Hrvoje Niksic + + * sysdep.h: Include the stdbool.h/_Bool/bool blurb from Autoconf. + 2005-06-22 Hrvoje Niksic * init.c (cmd_lockable_boolean): Removed. diff --git a/src/sysdep.h b/src/sysdep.h index 8cadccb5..a3bebe97 100644 --- a/src/sysdep.h +++ b/src/sysdep.h @@ -63,6 +63,24 @@ so, delete this exception statement from your version. */ # include #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 +#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