summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2012-12-17 02:09:22 +0100
committerYang Tse <yangsita@gmail.com>2012-12-17 02:09:22 +0100
commitc220b29b3ccbc6683087a58f4c6ac0451b23eacf (patch)
treee4a9700b3a4ce306f05097296a6b37da5ed17020
parent84eb2dc22061df3e04cad921336123e88423715b (diff)
downloadc-ares-c220b29b3ccbc6683087a58f4c6ac0451b23eacf.tar.gz
c-ares-c220b29b3ccbc6683087a58f4c6ac0451b23eacf.tar.bz2
c-ares-c220b29b3ccbc6683087a58f4c6ac0451b23eacf.zip
setup_once.h: HP-UX specific 'bool', 'false' and 'true' definitions.
Also reverts commit bceb40095a
-rw-r--r--setup_once.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/setup_once.h b/setup_once.h
index 5822b49..9473a80 100644
--- a/setup_once.h
+++ b/setup_once.h
@@ -288,6 +288,18 @@ struct timeval {
/*
+ * '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 <stdbool.h>, i.e. C99 platforms.
* On non-C99 platforms there's no bool, so define an enum for that.
* On C99 platforms 'false' and 'true' also exist. Enum uses a
@@ -328,18 +340,6 @@ struct timeval {
/*
- * 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.
*/