include/qemu/bswap.h: Handle being included outside extern "C" block
commitb30a8c241fe22b9cbd0ad015809fc92688fee4ff
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 16 Apr 2021 13:55:42 +0000 (16 14:55 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 10 May 2021 16:21:54 +0000 (10 17:21 +0100)
treec8688f329c20fe4153106821faf6d2a99208722c
parent415a9fb880c6bf383d649643a4ce65ea3bc9b084
include/qemu/bswap.h: Handle being included outside extern "C" block

Make bswap.h handle being included outside an 'extern "C"' block:
all system headers are included first, then all declarations are
put inside an 'extern "C"' block.

This requires a little rearrangement as currently we have an ifdef
ladder that has some system includes and some local declarations
or definitions, and we need to separate those out.

We want to do this because dis-asm.h includes bswap.h, dis-asm.h
may need to be included from C++ files, and system headers should
not be included within 'extern "C"' blocks.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
include/qemu/bswap.h