[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/15] rewrite QEMU_BUILD_BUG_ON
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 12/15] rewrite QEMU_BUILD_BUG_ON |
Date: |
Fri, 10 Feb 2012 13:47:41 +0100 |
From: Dong Xu Wang <address@hidden>
On some platforms, __LINE__ will not expand to real number in QEMU_BUILD_BUG_ON,
so if using QEMU_BUILD_BUG_ON twice, compiler will report errors. This patch
will
fix it.
BTW, I got error message on RHEL 6.1/gcc 4.4.5.
Signed-off-by: Dong Xu Wang <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
compiler.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/compiler.h b/compiler.h
index a1c0794..736e770 100644
--- a/compiler.h
+++ b/compiler.h
@@ -30,8 +30,10 @@
# define QEMU_PACKED __attribute__((packed))
#endif
+#define cat(x,y) x ## y
+#define cat2(x,y) cat(x,y)
#define QEMU_BUILD_BUG_ON(x) \
- typedef char qemu_build_bug_on__##__LINE__[(x)?-1:1];
+ typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1];
#if defined __GNUC__
# if !QEMU_GNUC_PREREQ(4, 4)
--
1.7.6.5
- [Qemu-devel] [PATCH 01/15] cutils: extract buffer_is_zero() from qemu-img.c, (continued)
- [Qemu-devel] [PATCH 01/15] cutils: extract buffer_is_zero() from qemu-img.c, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 02/15] block: add .bdrv_co_write_zeroes() interface, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 03/15] block: perform zero-detection during copy-on-read, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 04/15] qed: replace is_write with flags field, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 05/15] qed: add .bdrv_co_write_zeroes() support, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 06/15] qemu-io: add write -z option for bdrv_co_write_zeroes, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 14/15] sheepdog: fix co_recv coroutine context, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 15/15] AHCI: Masking of IRQs actually masks them, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 09/15] vpc: Round up image size during fixed image creation, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 11/15] qcow2: Keep unknown header extension when rewriting header, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 12/15] rewrite QEMU_BUILD_BUG_ON,
Kevin Wolf <=
- [Qemu-devel] [PATCH 10/15] qcow2: Update whole header at once, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 08/15] vpc: Add support for Fixed Disk type, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 13/15] AHCI: Fix port reset race, Kevin Wolf, 2012/02/10
- [Qemu-devel] [PATCH 07/15] iSCSI: add configuration variables for iSCSI, Kevin Wolf, 2012/02/10
- Re: [Qemu-devel] [PULL 00/15] Block patches, Kevin Wolf, 2012/02/15
- Re: [Qemu-devel] [PULL 00/15] Block patches, Anthony Liguori, 2012/02/15