[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
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 00/14] More #include cleanups, Peter Maydell, 2016/02/09
- [Qemu-devel] [PATCH 07/14] libdecnumber: Clean up includes, Peter Maydell, 2016/02/09
- [Qemu-devel] [PATCH 13/14] all: Clean up includes, Peter Maydell, 2016/02/09
- [Qemu-devel] [PATCH 12/14] scripts/tracetool: Include qemu/osdep.h in generated .c files, Peter Maydell, 2016/02/09
- [Qemu-devel] [PATCH 14/14] oslib-posix.c: Move workaround for OSX daemon() deprecation to osdep.h, Peter Maydell, 2016/02/09
- [Qemu-devel] [PATCH 04/14] hw/block/nand.c: Include osdep.h first, Peter Maydell, 2016/02/09
- [Qemu-devel] [PATCH 02/14] ui/cocoa.m: Include qemu/osdep.h, Peter Maydell, 2016/02/09
- [Qemu-devel] [PATCH 05/14] target-cris: Remove unnecessary ifdef from mmu.c, Peter Maydell, 2016/02/09
- [Qemu-devel] [PATCH 08/14] tests/i440fx-test: Don't define ARRAY_SIZE locally, Peter Maydell, 2016/02/09