qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 03/14] disas/arm-a64.cc: Include osdep.h first


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 03/14] disas/arm-a64.cc: Include osdep.h first
Date: Thu, 18 Feb 2016 10:15:14 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 02/18/2016 08:49 AM, Peter Maydell wrote:
> On 9 February 2016 at 15:25, Peter Maydell <address@hidden> wrote:
>> Rearrange include directives so that we include osdep.h first.
>> This has to be done manually because clean-includes doesn't
>> handle C++.
>>

>> -#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 <stdint.h> 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 <stdint.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
> 
> 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.)

(3) has my vote as well; it's the approach used by gnulib (wherever
practical, do whatever wrapping it takes to make all standard headers
appear like the most modern version of said header, even on older platforms)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]