]> sjero.net Git - wget/blobdiff - src/sysdep.h
[svn] Check for the C99 bool type and define it if missing.
[wget] / src / sysdep.h
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