qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 00/14] More #include cleanups


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 00/14] More #include cleanups
Date: Tue, 9 Feb 2016 10:18:19 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 02/09/2016 10:10 AM, Eric Blake wrote:

> but with the new header order it expands to:
> 
> # 1989 "/usr/include/c++/5.3.1/x86_64-redhat-linux/bits/c++config.h" 3
> namespace std
> {
> 
> # 1991 "/usr/include/c++/5.3.1/x86_64-redhat-linux/bits/c++config.h"
>  __attribute__ (( always_inline )) __inline__
> # 1991 "/usr/include/c++/5.3.1/x86_64-redhat-linux/bits/c++config.h" 3
>         namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
> }
> 
> So _something_ in osdep.h is redefining 'inline' with disastrous effects
> to C++.

This hack seems to fix things; but I'm not enough of a C++ expert to
know if it is the best fix.

diff --git i/include/qemu/compiler.h w/include/qemu/compiler.h
index d22eb01..d50b806 100644
--- i/include/qemu/compiler.h
+++ w/include/qemu/compiler.h
@@ -77,6 +77,7 @@
 #define typeof_field(type, field) typeof(((type *)0)->field)
 #define type_check(t1,t2) ((t1*)0 - (t2*)0)

+#ifndef __cplusplus
 #ifndef always_inline
 #if !((__GNUC__ < 3) || defined(__APPLE__))
 #ifdef __OPTIMIZE__
@@ -88,6 +89,7 @@
 #undef inline
 #define inline always_inline
 #endif
+#endif

 #define QEMU_BUILD_BUG_ON(x) \
     typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1]
__attribute__((unused));


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]