From 4939923d3a8487f6644b1feb657693d8f929297b Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 28 Aug 2018 23:59:35 +0100 Subject: [PATCH] scanner: Reverse expat/libxml include order libxml2 unconditonally defines XMLCALL to nothing. Expat does not redefine XMLCALL if it is already defined, but if it is not, and we are building with gcc on i386 (not x86-64), it will define it as 'cdecl'. Including Expat before libxml thus results in a warning about XMLCALL being redefined. Luckily we can get around this by just reversing the include order: cdecl is a no-op on Unix-like systems, so by having libxml first define XMLCALL to nothing and including Expat afterwards, we avoid the warning and lose nothing. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen Reviewed-by: Peter Hutterer --- src/scanner.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scanner.c b/src/scanner.c index 084f196..a94be5d 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -48,6 +47,10 @@ extern char DTD_DATA_begin; extern int DTD_DATA_len; #endif +/* Expat must be included after libxml as both want to declare XMLCALL; see + * the Git commit that 'git blame' for this comment points to for more. */ +#include + #include "wayland-util.h" #define PROGRAM_NAME "wayland-scanner" -- 2.7.4