From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: [PATCH 3/3] xen: Add stdbool.h workaround for BSD. Date: Thu, 15 Aug 2013 14:25:07 +0100 Message-ID: <1376573107-27249-4-git-send-email-tim@xen.org> References: <1376573107-27249-1-git-send-email-tim@xen.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1376573107-27249-1-git-send-email-tim@xen.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: keir@xen.org, ian.campbell@citrix.com, chegger@amazon.de, Ian.Jackson@eu.citrix.com, prlw1@cam.ac.uk, stefano.stabellini@citrix.com, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org On *BSD, stdbool.h lives in /usr/include, but we don't want to have that on the search path in case we pick up any headers from the build host's C libraries. Copy the equivalent hack already in place for stdarg.h: on all supported compilers the contents of stdbool.h are trivial, so just supply the things we need in a xen/stdbool.h header. Signed-off-by: Tim Deegan --- xen/include/xen/libelf.h | 4 ++-- xen/include/xen/stdbool.h | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 xen/include/xen/stdbool.h diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h index e65db6d..6393040 100644 --- a/xen/include/xen/libelf.h +++ b/xen/include/xen/libelf.h @@ -29,8 +29,6 @@ #error define architectural endianness #endif -#include - typedef int elf_errorstatus; /* 0: ok; -ve (normally -1): error */ typedef int elf_negerrnoval; /* 0: ok; -EFOO: error */ @@ -39,12 +37,14 @@ typedef int elf_negerrnoval; /* 0: ok; -EFOO: error */ #ifdef __XEN__ #include #include +#include #include #else #include #include #include +#include #include struct elf_binary; diff --git a/xen/include/xen/stdbool.h b/xen/include/xen/stdbool.h new file mode 100644 index 0000000..2eecd52 --- /dev/null +++ b/xen/include/xen/stdbool.h @@ -0,0 +1,13 @@ +#ifndef __XEN_STDBOOL_H__ +#define __XEN_STDBOOL_H__ + +#if defined(__OpenBSD__) || defined(__NetBSD__) +# define bool _Bool +# define true 1 +# define false 0 +# define __bool_true_false_are_defined 1 +#else +# include +#endif + +#endif /* __XEN_STDBOOL_H__ */ -- 1.7.10.4