From a363e1c51f08cdb626407742e821e177d4c69573 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sat, 26 Jul 2008 16:13:29 +0000 Subject: [PATCH] * lib/defines.h: Make sure the booleans are defined before using them. --- ChangeLog | 5 +++++ lib/defines.h | 32 ++++++++++++++++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9c45c88..f69f0373 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-26 Nicolas François + + * lib/defines.h: Make sure the booleans are defined before using + them. + 2008-07-26 Nicolas François * src/groupmems.c: Added Prog global variable to indicate the name diff --git a/lib/defines.h b/lib/defines.h index 4d536fbe..8381d82c 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -6,6 +6,22 @@ #include +#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 + #define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c)) /* Take care of NLS matters. */ @@ -334,20 +350,4 @@ 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_ */