From: Yang Tse Date: Mon, 17 Dec 2012 01:07:10 +0000 (+0100) Subject: setup_once.h: HP-UX specific 'bool', 'false' and 'true' definitions. X-Git-Tag: curl-7_29_0~208 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8dde1cf199234e78feeef62ac14a644028f5373;p=curl setup_once.h: HP-UX specific 'bool', 'false' and 'true' definitions. Also reverts commit f254c59dc7 --- diff --git a/lib/setup_once.h b/lib/setup_once.h index df28af2f8..e7104b071 100644 --- a/lib/setup_once.h +++ b/lib/setup_once.h @@ -304,6 +304,18 @@ struct timeval { #define TOLOWER(x) (tolower((int) ((unsigned char)x))) +/* + * 'bool' stuff compatible with HP-UX headers. + */ + +#if defined(__hpux) && !defined(HAVE_BOOL_T) + typedef int bool; +# define false 0 +# define true 1 +# define HAVE_BOOL_T +#endif + + /* * 'bool' exists on platforms with , i.e. C99 platforms. * On non-C99 platforms there's no bool, so define an enum for that. @@ -344,18 +356,6 @@ struct timeval { #endif -/* - * Some HP-UX system headers require TRUE defined to 1 and FALSE to 0. - */ - -#if defined(__hpux) -#undef TRUE -#define TRUE 1 -#undef FALSE -#define FALSE 0 -#endif - - /* * Macro WHILE_FALSE may be used to build single-iteration do-while loops, * avoiding compiler warnings. Mostly intended for other macro definitions.