diff options
author | Markus Armbruster <armbru@redhat.com> | 2016-03-11 13:41:13 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-03-22 22:20:16 +0100 |
commit | a8139632161d7546218b696cada0a4f64cc78fb7 (patch) | |
tree | c21aad2b0ab698e9882364f8608812f7e2461f6b /include/qemu/bswap.h | |
parent | a7c4d9c7ca5178d32236fa5b31fa7fed4e4a7a9c (diff) | |
download | qemu-a8139632161d7546218b696cada0a4f64cc78fb7.zip qemu-a8139632161d7546218b696cada0a4f64cc78fb7.tar.gz qemu-a8139632161d7546218b696cada0a4f64cc78fb7.tar.bz2 |
Move HOST_LONG_BITS from qemu-common.h to qemu/osdep.h
qemu-common.h should only be included by .c files. Its file comment
explains why: "No header file should depend on qemu-common.h, as this
would easily lead to circular header dependencies."
One of the reasons for headers to include it is HOST_LONG_BITS. Move
that to its more natural home qemu/osdep.h, to facilitate removing
these ill-advised includes later on.
This also lets us use HOST_LONG_BITS in bswap.h instead of duplicating
its definition there to avoid cyclic inclusion.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qemu/bswap.h')
-rw-r--r-- | include/qemu/bswap.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 95071ba..fcedf0d 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -419,11 +419,9 @@ static inline void stfq_be_p(void *ptr, float64 v) static inline unsigned long leul_to_cpu(unsigned long v) { - /* In order to break an include loop between here and - qemu-common.h, don't rely on HOST_LONG_BITS. */ -#if ULONG_MAX == UINT32_MAX +#if HOST_LONG_BITS == 32 return le_bswap(v, 32); -#elif ULONG_MAX == UINT64_MAX +#elif HOST_LONG_BITS == 64 return le_bswap(v, 64); #else # error Unknown sizeof long |