diff mbox

[04/12] compiler.h: Use glue() in QEMU_BUILD_BUG_ON define

Message ID 1437583451-9677-5-git-send-email-peter.maydell@linaro.org
State New
Headers show

Commit Message

Peter Maydell July 22, 2015, 4:44 p.m. UTC
Rather than rolling custom concatenate-strings macros for the
QEMU_BUILD_BUG_ON macro to use, use the glue() macro we already
have (since it's now available to us in this header).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 include/qemu/compiler.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Daniel P. Berrangé July 31, 2015, 12:48 p.m. UTC | #1
On Wed, Jul 22, 2015 at 05:44:03PM +0100, Peter Maydell wrote:
> Rather than rolling custom concatenate-strings macros for the
> QEMU_BUILD_BUG_ON macro to use, use the glue() macro we already
> have (since it's now available to us in this header).
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  include/qemu/compiler.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>


Regards,
Daniel
diff mbox

Patch

diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index bdc9a60..d22eb01 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -89,10 +89,8 @@ 
 #define inline always_inline
 #endif
 
-#define cat(x,y) x ## y
-#define cat2(x,y) cat(x,y)
 #define QEMU_BUILD_BUG_ON(x) \
-    typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1] __attribute__((unused));
+    typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1] __attribute__((unused));
 
 #if defined __GNUC__
 # if !QEMU_GNUC_PREREQ(4, 4)