]> sjero.net Git - wget/commitdiff
[svn] Check for the C99 bool type and define it if missing.
authorhniksic <devnull@localhost>
Wed, 22 Jun 2005 17:51:29 +0000 (10:51 -0700)
committerhniksic <devnull@localhost>
Wed, 22 Jun 2005 17:51:29 +0000 (10:51 -0700)
ChangeLog
configure.in
src/ChangeLog
src/sysdep.h

index 3bb1f5638b953ef7203cd4c492684c25ee969c60..07758b685ecae39e6768c77746e473882ef9a199 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * configure.in: Check for C99 conformant stdbool.h.
+
 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * MAILING-LIST: Remove reference to the obsolete `wget-cvs'
index 1ea9f10eddd6949c2ff8f654628b6f6361f77dbd..a38a36078564b6b874117241cc0d86c26db934b2 100644 (file)
@@ -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)
index 084310f7b6e91975e083a571a898a9428b710e06..dd1c0ac56a6279c8421ad4e59ff5de31f74154ea 100644 (file)
@@ -1,3 +1,7 @@
+2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * sysdep.h: Include the stdbool.h/_Bool/bool blurb from Autoconf.
+
 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * init.c (cmd_lockable_boolean): Removed.
index 8cadccb5f4df8065f58fb933cf22ffdc5745c820..a3bebe97b5f78932f09b013b780ce0ec4138cbed 100644 (file)
@@ -63,6 +63,24 @@ so, delete this exception statement from your version.  */
 # 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