summaryrefslogtreecommitdiffstats
path: root/src/compat
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2012-04-27 15:09:15 +0300
committerDavid Sommerseth <davids@redhat.com>2012-04-28 00:09:46 +0200
commit4029971240b6274b9b30e76ff74c7f689d7d9750 (patch)
tree02ee41e617185102cd9c79eae4e2dc172b4e863c /src/compat
parent34091048af1ba94e8bf2049354610d16f8bb3d4c (diff)
downloadopenvpn-4029971240b6274b9b30e76ff74c7f689d7d9750.tar.gz
openvpn-4029971240b6274b9b30e76ff74c7f689d7d9750.tar.xz
openvpn-4029971240b6274b9b30e76ff74c7f689d7d9750.zip
build: use stdbool.h if available
If stdbool.h is available use it, otherwise create emulation. basic.h defines a type 'bool' that conflicts with the altivec keyword bool which has to be fixed upstream, see bugs[1][2]. [1] https://bugs.gentoo.org/show_bug.cgi?id=293840 [2] https://bugs.gentoo.org/show_bug.cgi?id=297854 Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: David Sommerseth <davids@redhat.com> Message-Id: 1335528555-13225-1-git-send-email-alon.barlev@gmail.com URL: http://article.gmane.org/gmane.network.openvpn.devel/6363 Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'src/compat')
-rw-r--r--src/compat/Makefile.am1
-rw-r--r--src/compat/compat-stdbool.h12
2 files changed, 13 insertions, 0 deletions
diff --git a/src/compat/Makefile.am b/src/compat/Makefile.am
index 5ee35f7..7ad4452 100644
--- a/src/compat/Makefile.am
+++ b/src/compat/Makefile.am
@@ -20,6 +20,7 @@ noinst_LTLIBRARIES = libcompat.la
libcompat_la_SOURCES = \
compat.h \
+ compat-stdbool.h \
compat-dirname.c \
compat-basename.c \
compat-gettimeofday.c \
diff --git a/src/compat/compat-stdbool.h b/src/compat/compat-stdbool.h
new file mode 100644
index 0000000..9941218
--- /dev/null
+++ b/src/compat/compat-stdbool.h
@@ -0,0 +1,12 @@
+#ifndef __COMPAT_STDBOOL_H
+#define __COMPAT_STDBOOL_H
+
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#else
+typedef int bool;
+#define false 0
+#define true 1
+#endif
+
+#endif