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>
AC_CHECK_SIZEOF([unsigned int])
AC_CHECK_SIZEOF([unsigned long])
AC_CHECK_HEADERS([ \
- stdio.h stdarg.h limits.h \
+ stdio.h stdarg.h stdbool.h limits.h \
time.h errno.h fcntl.h io.h direct.h \
ctype.h sys/types.h sys/socket.h \
signal.h unistd.h dlfcn.h \
libcompat_la_SOURCES = \
compat.h \
+ compat-stdbool.h \
compat-dirname.c \
compat-basename.c \
compat-gettimeofday.c \
--- /dev/null
+#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
#ifndef BASIC_H
#define BASIC_H
-/* bool definitions */
-#ifndef bool
-#define bool int
-#endif
-
-#ifndef true
-#define true 1
-#endif
-
-#ifndef false
-#define false 0
-#endif
-
#define BOOL_CAST(x) ((x) ? (true) : (false))
/* size of an array */
#define SYSHEAD_H
#include "compat.h"
+#include "compat-stdbool.h"
/* branch prediction hints */
#if defined(__GNUC__)