From: Wei Liu Date: Mon, 19 Sep 2016 18:13:04 +0000 (+0100) Subject: Fix issues introduced in 3a7f872a X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8fec44f23cf59d9be02df055b40e9f9536a0d570;p=people%2Froyger%2Fxen.git Fix issues introduced in 3a7f872a 3a7f872a ("tools: lift BUILD_BUG_ON to a tools header file") was taken out from an rather old half finished branch by dropping unrelated changes. Unfortunately two issues sneaked in. 1. Hvmloader should be standalone. Revert the changes to hvmloader. 2. The define guard in libs.h was erroneously deleted. Add that back. Signed-off-by: Wei Liu Acked-by: Jan Beulich Acked-by: Ian Jackson --- diff --git a/tools/firmware/hvmloader/rombios.c b/tools/firmware/hvmloader/rombios.c index 1e853ec1c9..9acf03fa5f 100644 --- a/tools/firmware/hvmloader/rombios.c +++ b/tools/firmware/hvmloader/rombios.c @@ -31,7 +31,6 @@ #include "option_rom.h" #include -#include #define ROM_INCLUDE_ROMBIOS #define ROM_INCLUDE_VGABIOS diff --git a/tools/firmware/hvmloader/smbios.c b/tools/firmware/hvmloader/smbios.c index 0e61bd1950..210c7b0d35 100644 --- a/tools/firmware/hvmloader/smbios.c +++ b/tools/firmware/hvmloader/smbios.c @@ -26,7 +26,6 @@ #include "util.h" #include "hypercall.h" #include -#include /* SBMIOS handle base values */ #define SMBIOS_HANDLE_TYPE0 0x0000 diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h index 94292d6f22..0fb266e95a 100644 --- a/tools/firmware/hvmloader/util.h +++ b/tools/firmware/hvmloader/util.h @@ -41,6 +41,7 @@ void __assert_failed(char *assertion, char *file, int line) void __bug(char *file, int line) __attribute__((noreturn)); #define BUG() __bug(__FILE__, __LINE__) #define BUG_ON(p) do { if (p) BUG(); } while (0) +#define BUILD_BUG_ON(p) ((void)sizeof(char[1 - 2 * !!(p)])) #define min_t(type,x,y) \ ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; }) diff --git a/tools/include/xen-tools/libs.h b/tools/include/xen-tools/libs.h index 9d8b4ab744..e874fb8267 100644 --- a/tools/include/xen-tools/libs.h +++ b/tools/include/xen-tools/libs.h @@ -1,4 +1,5 @@ #ifndef __XEN_TOOLS_LIBS__ +#define __XEN_TOOLS_LIBS__ #ifndef BUILD_BUG_ON #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)