aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils.h
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2009-05-06 07:30:38 -0400
committerTobias Brunner <tobias@strongswan.org>2009-05-06 09:11:13 -0400
commita9f56adb59323e889e2e8bcf53a3af997e01ecfc (patch)
tree6755b3afaa49a4bc622f97334d8916785bc54020 /src/libstrongswan/utils.h
parent938b230fa7b56218f8e423d1dedbdcc4bbb3b309 (diff)
downloadstrongswan-a9f56adb59323e889e2e8bcf53a3af997e01ecfc.tar.bz2
strongswan-a9f56adb59323e889e2e8bcf53a3af997e01ecfc.tar.xz
more portable handling of the bool data type (Mac OS X has stdbool.h)
Diffstat (limited to 'src/libstrongswan/utils.h')
-rw-r--r--src/libstrongswan/utils.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/libstrongswan/utils.h b/src/libstrongswan/utils.h
index 091890658..debd0145b 100644
--- a/src/libstrongswan/utils.h
+++ b/src/libstrongswan/utils.h
@@ -116,12 +116,22 @@
/**
* General purpose boolean type.
*/
-typedef int bool;
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+#else
+# ifndef HAVE__BOOL
+# define _Bool signed char
+# endif /* HAVE__BOOL */
+# define bool _Bool
+# define false 0
+# define true 1
+# define __bool_true_false_are_defined 1
+#endif /* HAVE_STDBOOL_H */
#ifndef FALSE
-# define FALSE 0
+# define FALSE false
#endif /* FALSE */
#ifndef TRUE
-# define TRUE 1
+# define TRUE true
#endif /* TRUE */
typedef enum status_t status_t;