| Submitter | Stefan Weil |
|---|---|
| Date | Jan. 30, 2013, 9:56 p.m. |
| Message ID | <51099715.8050602@weilnetz.de> |
| Download | mbox | patch |
| Permalink | /patch/216992/ |
| State | Under Review |
| Headers | show |
Comments
On 01/30/2013 01:56 PM, Stefan Weil wrote: > Could you please try whether this patch fixes the build problems: > > > From 4dd39af7a3e493669977ec6f50e91bf649b5727f Mon Sep 17 00:00:00 2001 > From: Stefan Weil <sw@weilnetz.de> > Date: Wed, 30 Jan 2013 22:52:12 +0100 > Subject: [PATCH] Fix build problems for big endian hosts > > Make sure that HOST_LONG_BITS is always defined when qemu/bswap.h > is included. > > Signed-off-by: Stefan Weil <sw@weilnetz.de> This probably works. And from the list of includes removed, looks good from a long-term maintenance point of view. I stand by my use of ULONG_MAX to match the unsigned long type though. r~
Am 30.01.2013 23:00, schrieb Richard Henderson: > On 01/30/2013 01:56 PM, Stefan Weil wrote: >> Could you please try whether this patch fixes the build problems: >> >> >> From 4dd39af7a3e493669977ec6f50e91bf649b5727f Mon Sep 17 00:00:00 2001 >> From: Stefan Weil <sw@weilnetz.de> >> Date: Wed, 30 Jan 2013 22:52:12 +0100 >> Subject: [PATCH] Fix build problems for big endian hosts >> >> Make sure that HOST_LONG_BITS is always defined when qemu/bswap.h >> is included. >> >> Signed-off-by: Stefan Weil <sw@weilnetz.de> > > This probably works. And from the list of includes removed, looks > good from a long-term maintenance point of view. > > I stand by my use of ULONG_MAX to match the unsigned long type though. > > > r~ > Andreas has pointed out that HOST_LONG_BITS was not correct in function leul_to_cpu, so your patch fixes a real bug for MinGW-w64. My patch only fixes the compilation. In the long term HOST_LONG_BITS should be renamed to HOST_PTR_BITS or HOST_POINTER_BITS to avoid future confusion and wrong use of this macro. Stefan
Patch
diff --git a/fsdev/virtio-9p-marshal.c b/fsdev/virtio-9p-marshal.c index 20f308b..4e634df 100644 --- a/fsdev/virtio-9p-marshal.c +++ b/fsdev/virtio-9p-marshal.c @@ -11,20 +11,10 @@ * */ -#include <glib.h> #include <glib/gprintf.h> -#include <sys/types.h> -#include <dirent.h> -#include <sys/time.h> -#include <utime.h> -#include <sys/uio.h> -#include <string.h> -#include <stdint.h> -#include <errno.h> -#include "qemu/compiler.h" +#include "qemu-common.h" #include "virtio-9p-marshal.h" -#include "qemu/bswap.h" void v9fs_string_free(V9fsString *str) { diff --git a/hw/spapr_nvram.c b/hw/spapr_nvram.c index 680cdba..2960b15 100644 --- a/hw/spapr_nvram.c +++ b/hw/spapr_nvram.c @@ -22,6 +22,8 @@ * THE SOFTWARE. */ +#include "qemu-common.h" + #include <libfdt.h> #include "sysemu/device_tree.h" diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index e6d4798..07dadc2 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -13,6 +13,10 @@ #elif defined(CONFIG_BYTESWAP_H) # include <byteswap.h> +#if !defined(HOST_LONG_BITS) +# error needs HOST_LONG_BITS +#endif + static inline uint16_t bswap16(uint16_t x) { return bswap_16(x);