From: Erik Rozendaal Date: Tue, 22 Feb 2005 11:20:44 +0000 (+0000) Subject: Try to be smarted about defining bool. X-Git-Tag: release-0.50~386 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f899eae132a9ce2bbb2c7af6209beb8a8c614e6;p=thirdparty%2Fldns.git Try to be smarted about defining bool. --- diff --git a/ldns/common.h b/ldns/common.h index 68272571..4fd595eb 100644 --- a/ldns/common.h +++ b/ldns/common.h @@ -13,19 +13,21 @@ #ifndef _LDNS_COMMON_H #define _LDNS_COMMON_H -#ifdef HAVE_STDBOOL_H -#include -#else +#if !defined(__cplusplus) && !defined(__bool_true_false_are_defined) -#ifndef __cplusplus +# if defined(HAVE_STDBOOL_H) +# include +# else typedef unsigned char bool; -#define false 0 -#define true 1 +# define bool bool +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 -#endif /* !__cplusplus */ +# endif -#endif /* !HAVE_STDBOOL_H */ +#endif #ifdef HAVE_ATTR_FORMAT #define ATTR_FORMAT(archetype, string_index, first_to_check) \