From: Martin Husemann <martin@duskware.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v2] qemu 1.7.0 does not build on NetBSD
Date: Sat, 18 Jan 2014 14:47:23 +0100 [thread overview]
Message-ID: <20140118134723.GA20716@mail.duskware.de> (raw)
In-Reply-To: <52D68012.8090603@redhat.com>
Do not rely on int8_t (and friends) not being preprocessor
symbols (or symbols expanding to themselves). On NetBSD (for example) the
glue(u, SDATA_TYPE) results in u__int8_t, which is undefined. There is no way
to stop cpp expanding inner macros, so just add the few lines explicitly and
get rid of the magic.
Signed-off-by: Martin Husemann <martin@NetBSD.org>
---
include/exec/softmmu_template.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/exec/softmmu_template.h b/include/exec/softmmu_template.h
index c6a5440..8712dcd 100644
--- a/include/exec/softmmu_template.h
+++ b/include/exec/softmmu_template.h
@@ -30,23 +30,26 @@
#define SUFFIX q
#define LSUFFIX q
#define SDATA_TYPE int64_t
+#define DATA_TYPE uint64_t
#elif DATA_SIZE == 4
#define SUFFIX l
#define LSUFFIX l
#define SDATA_TYPE int32_t
+#define DATA_TYPE uint32_t
#elif DATA_SIZE == 2
#define SUFFIX w
#define LSUFFIX uw
#define SDATA_TYPE int16_t
+#define DATA_TYPE uint16_t
#elif DATA_SIZE == 1
#define SUFFIX b
#define LSUFFIX ub
#define SDATA_TYPE int8_t
+#define DATA_TYPE uint8_t
#else
#error unsupported data size
#endif
-#define DATA_TYPE glue(u, SDATA_TYPE)
/* For the benefit of TCG generated code, we want to avoid the complication
of ABI-specific return type promotion and always return a value extended
--
1.8.5.3
next prev parent reply other threads:[~2014-01-18 13:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-17 8:55 [Qemu-devel] qemu 1.7.0 does not build on NetBSD (patch) Martin Husemann
2013-12-17 10:15 ` Paolo Bonzini
2014-01-15 12:33 ` Paolo Bonzini
2014-01-18 13:47 ` Martin Husemann [this message]
2014-01-18 13:59 ` [Qemu-devel] [PATCH v2] qemu 1.7.0 does not build on NetBSD Peter Maydell
2014-01-21 15:38 ` Richard Henderson
2014-01-21 15:42 ` Andreas Färber
2014-01-21 18:11 ` Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140118134723.GA20716@mail.duskware.de \
--to=martin@duskware.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).