Received: from eggs.gnu.org ([2001:4830:134:3::10]:54229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWRdk-0007Zt-JT for qemu-devel@nongnu.org; Thu, 18 Feb 2016 11:41:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWRdg-0001hO-Dl for qemu-devel@nongnu.org; Thu, 18 Feb 2016 11:41:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWRdg-0001h5-7j for qemu-devel@nongnu.org; Thu, 18 Feb 2016 11:41:12 -0500 From: Markus Armbruster References: <1455031511-23684-1-git-send-email-peter.maydell@linaro.org> <1455031511-23684-4-git-send-email-peter.maydell@linaro.org> Date: Thu, 18 Feb 2016 17:41:09 +0100 In-Reply-To: (Peter Maydell's message of "Thu, 18 Feb 2016 15:49:51 +0000") Message-ID: <8760xm9dju.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 03/14] disas/arm-a64.cc: Include osdep.h first List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Patch Tracking Peter Maydell writes: > On 9 February 2016 at 15:25, Peter Maydell wrote: >> Rearrange include directives so that we include osdep.h first. >> This has to be done manually because clean-includes doesn't >> handle C++. >> >> Signed-off-by: Peter Maydell >> --- >> disas/arm-a64.cc | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/disas/arm-a64.cc b/disas/arm-a64.cc >> index d4d46d5..9280950 100644 >> --- a/disas/arm-a64.cc >> +++ b/disas/arm-a64.cc >> @@ -17,12 +17,13 @@ >> * along with this program. If not, see . >> */ >> >> -#include "vixl/a64/disasm-a64.h" >> - >> extern "C" { >> +#include "qemu/osdep.h" >> #include "disas/bfd.h" >> } >> >> +#include "vixl/a64/disasm-a64.h" >> + >> using namespace vixl; >> >> static Decoder *vixl_decoder = NULL; > > So this patch doesn't build on the old mingw32 compiler. I think this > is because this compiler is not C++11, and so its doesn't > provide various macros for C++ unless __STDC_CONSTANT_MACROS, > __STDC_LIMIT_MACROS and __STDC_FORMAT_MACROS are defined before the > first inclusion of . > > libvixl's globals.h defines these constants, but this only works if > globals.h is first-include, so making osdep.h first-include then > results in stdint.h being included before globals.h has a chance > to set the defines. > > What's the best way to deal with this? I can see a couple of options: > > (1) as a special case, for this file include disasm-a64.h before > osdep.h > (2) as a special case, for this file manually define the __STDC_* > before including osdep.h > (3) make osdep.h itself define the __STDC_* constants so it works > with C++-before-C++11 as well as with C and with C++11 (4) Tell old mingw32 to take a hike :) > I think I prefer (3) (though it does mean we will have to tweak > osdep.h in future if a new vixl version should ever require any > further similar #defines.) Doesn't sound like a deal-breaker to me.