This patchset makes more progress with with cleaning our include use and is hopefully the last of the big ones (there are some other minor fixups that can be done after).
Patch 1 is already in Andreas' QOM tree but I include it for convenience since without it things will fail to compile later in the series. Patch 2 fixes a problem with including osdep.h first in arm-a64.cc if the compiler doesn't support C++11 Patch 3 is the previously sent arm-a64.cc change Patches 4 and 5 add support to the clean-includes script for working on .h files, and for saying "run on everything in the source tree" Patch 6 fixes something I had forgotten about -- osdep.h needs to include config-target.h if the object file being built is a per-target one! Patch 7 is the results of cleaning everything except include/. Patch 8 cleans include/. In particular, since patch 8 removes the osdep.h include from qemu-common.h it is where you will see compile failures if anything isn't including osdep.h (this builds fine against current master but might break in-flight patches and other out of tree code if it does not include osdep.h everywhere it should). I could split patches 7 and 8 up into smaller chunks if that seems helpful to people, but I figured they weren't too terrible as-is. thanks -- PMM Peter Maydell (8): cpu: Clean up includes osdep.h: Define macros for the benefit of C++ before C++11 disas/arm-a64.cc: Include osdep.h first scripts/clean-includes: Enhance to handle header files scripts/clean-includes: Add --all option osdep.h: Include config-target.h if NEED_CPU_H is defined all: Clean up includes include: Clean up includes audio/audio.h | 1 - bsd-user/qemu.h | 3 -- contrib/ivshmem-client/ivshmem-client.h | 1 - contrib/ivshmem-server/ivshmem-server.h | 3 -- disas/arm-a64.cc | 5 ++- fsdev/file-op-9p.h | 3 -- hw/9pfs/9p-synth.h | 3 -- hw/9pfs/9p.h | 2 - hw/audio/gusemu.h | 1 - hw/display/vga_int.h | 1 - hw/net/fsl_etsec/registers.h | 1 - hw/usb/desc.h | 1 - include/block/accounting.h | 2 - include/block/nbd.h | 1 - include/block/snapshot.h | 1 - include/block/write-threshold.h | 1 - include/config.h | 1 - include/crypto/cipher.h | 1 - include/crypto/hash.h | 1 - include/crypto/init.h | 1 - include/crypto/secret.h | 1 - include/crypto/tlscreds.h | 1 - include/elf.h | 1 - include/exec/cpu-all.h | 1 - include/exec/cpu-defs.h | 3 -- include/exec/helper-head.h | 1 - include/exec/memory.h | 3 -- include/exec/user/thunk.h | 1 - include/fpu/softfloat.h | 3 -- include/hw/acpi/acpi.h | 1 - include/hw/acpi/aml-build.h | 2 - include/hw/acpi/bios-linker-loader.h | 2 - include/hw/acpi/pcihp.h | 1 - include/hw/block/block.h | 1 - include/hw/i386/topology.h | 2 - include/hw/isa/apm.h | 1 - include/hw/nvram/fw_cfg.h | 2 - include/hw/pci/pci.h | 1 - include/hw/pci/shpc.h | 1 - include/hw/qdev-core.h | 1 - include/hw/virtio/vhost-backend.h | 1 - include/hw/xen/xen.h | 1 - include/hw/xen/xen_common.h | 3 -- include/io/channel.h | 1 - include/io/task.h | 1 - include/libdecnumber/dconfig.h | 1 - include/libdecnumber/decContext.h | 3 -- include/libdecnumber/decNumberLocal.h | 2 - include/migration/migration.h | 1 - include/migration/qemu-file.h | 1 - include/net/checksum.h | 1 - include/net/eth.h | 2 - include/qapi/error.h | 3 -- include/qapi/qmp-event.h | 1 - include/qapi/qmp/dispatch.h | 1 - include/qapi/qmp/json-lexer.h | 1 - include/qapi/qmp/json-parser.h | 1 - include/qapi/qmp/json-streamer.h | 2 - include/qapi/qmp/qbool.h | 1 - include/qapi/qmp/qdict.h | 2 - include/qapi/qmp/qfloat.h | 1 - include/qapi/qmp/qint.h | 1 - include/qapi/qmp/qjson.h | 2 - include/qapi/qmp/qobject.h | 2 - include/qapi/qmp/qstring.h | 1 - include/qapi/visitor-impl.h | 1 - include/qapi/visitor.h | 2 - include/qemu-common.h | 1 - include/qemu/atomic.h | 1 - include/qemu/bitmap.h | 3 -- include/qemu/bitops.h | 2 - include/qemu/bswap.h | 5 --- include/qemu/compatfd.h | 1 - include/qemu/compiler.h | 1 - include/qemu/config-file.h | 2 - include/qemu/coroutine.h | 1 - include/qemu/error-report.h | 3 -- include/qemu/fprintf-fn.h | 2 - include/qemu/hbitmap.h | 3 -- include/qemu/host-utils.h | 3 -- include/qemu/int128.h | 3 -- include/qemu/log.h | 4 -- include/qemu/memfd.h | 2 - include/qemu/module.h | 1 - include/qemu/option.h | 2 - include/qemu/osdep.h | 17 +++++++++ include/qemu/range.h | 1 - include/qemu/rcu.h | 7 ---- include/qemu/sockets.h | 2 - include/qemu/thread.h | 2 - include/qemu/throttle.h | 1 - include/qemu/timed-average.h | 1 - include/qemu/xattr.h | 1 - include/qom/cpu.h | 1 - include/qom/object.h | 3 -- include/sysemu/block-backend.h | 1 - include/sysemu/blockdev.h | 1 - include/sysemu/dma.h | 1 - include/sysemu/hostmem.h | 1 - include/sysemu/kvm.h | 2 - include/sysemu/numa.h | 1 - include/sysemu/os-posix.h | 1 - include/sysemu/qtest.h | 1 - include/sysemu/replay.h | 3 -- include/sysemu/rng.h | 1 - include/sysemu/seccomp.h | 1 - include/sysemu/tpm_backend.h | 1 - include/sysemu/xen-mapcache.h | 1 - include/ui/console.h | 1 - include/ui/qemu-spice.h | 1 - io/channel-util.c | 1 + linux-user/arm/nwfpe/fpa11.h | 3 -- linux-user/qemu.h | 3 -- nbd/nbd-internal.h | 4 -- net/tap-linux.h | 1 - net/util.h | 1 - qemu-nbd.c | 2 - qga/vss-win32.h | 1 - qga/vss-win32/requester.h | 1 - qga/vss-win32/vss-common.h | 1 - qom/cpu.c | 1 + replay/replay-internal.h | 1 - scripts/clean-includes | 66 ++++++++++++++++++++++++++++----- slirp/slirp.h | 18 --------- target-alpha/cpu.h | 1 - target-arm/cpu.h | 1 - target-arm/kvm-consts.h | 1 - target-cris/cpu.h | 1 - target-i386/cpu-qom.h | 1 - target-i386/cpu.c | 5 +-- target-i386/cpu.h | 1 - target-i386/mpx_helper.c | 1 + target-lm32/cpu.h | 1 - target-m68k/cpu.h | 1 - target-microblaze/cpu.h | 1 - target-mips/cpu.h | 1 - target-moxie/cpu.h | 1 - target-openrisc/cpu.h | 1 - target-ppc/cpu.h | 1 - target-s390x/cpu.h | 1 - target-sh4/cpu.h | 1 - target-sparc/cpu.h | 1 - target-tilegx/cpu.h | 1 - target-tricore/cpu.h | 1 - target-unicore32/cpu.h | 1 - target-xtensa/cpu.h | 1 - tcg/tci/tcg-target.h | 1 - tests/libqos/ahci.h | 3 -- tests/libqos/fw_cfg.h | 2 - tests/libqos/i2c.h | 1 - tests/libqos/malloc.h | 2 - tests/libqos/pci.h | 1 - tests/libqtest.h | 6 --- trace/control-internal.h | 1 - trace/ftrace.h | 1 - trace/simple.h | 3 -- ui/vnc-palette.h | 2 - ui/vnc.h | 1 - 158 files changed, 81 insertions(+), 271 deletions(-) -- 1.9.1