aboutsummaryrefslogtreecommitdiff
path: root/lib/setup_once.h
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-22 02:51:54 +0000
committerYang Tse <yangsita@gmail.com>2007-02-22 02:51:54 +0000
commit69565afab0be081211df57a245a222cbd3e43ed3 (patch)
tree834ab5e7265abad18a542da69d7d65fba831cee3 /lib/setup_once.h
parent39aac6352159b4ba92463ec95b9e3df49a5b6693 (diff)
Check for stdbool.h at configuration stage, and include it if available.
Check for lowercase 'bool' type at configuration stage. If not available provide a suitable replacement with a type definition of 'unsigned char' in setup_once.h Move definitions of TRUE and FALSE to setup_once.h
Diffstat (limited to 'lib/setup_once.h')
-rw-r--r--lib/setup_once.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/setup_once.h b/lib/setup_once.h
index 7af68bf3f..79324d40f 100644
--- a/lib/setup_once.h
+++ b/lib/setup_once.h
@@ -69,6 +69,10 @@
#include <fcntl.h>
#endif
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+
/*
* Definition of timeval struct for platforms that don't have it.
@@ -184,6 +188,28 @@ struct timeval {
/*
+ * Typedef to 'unsigned char' if bool is not an available 'typedefed' type.
+ */
+
+#ifndef HAVE_BOOL_T
+typedef unsigned char bool;
+#define HAVE_BOOL_T
+#endif
+
+
+/*
+ * Default definition of uppercase TRUE and FALSE.
+ */
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+
+/*
* Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type.
*/