From ae75a8c0c12069d0f9212b04e0f268f8a5d0ec69 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sun, 25 May 2008 20:37:51 +0000 Subject: [PATCH] Allow usage of booleans in the source. --- ChangeLog | 5 +++++ lib/defines.h | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index 04d41b34..3ff7b476 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-25 Nicolas François + + * configure.in, lib/defines.h: Allow usage of booleans in the + source. + 2008-05-25 Nicolas François * configure.in: Allow --disable-man and --enable-man=no. diff --git a/lib/defines.h b/lib/defines.h index a3ab5aaf..e946109e 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -321,4 +321,20 @@ extern char *strerror (); # define unused #endif +#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 + #endif /* _DEFINES_H_ */