From patchwork Tue Feb 9 17:18:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 8264101 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4DB2FBEEE5 for ; Tue, 9 Feb 2016 17:18:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 715FF2022D for ; Tue, 9 Feb 2016 17:18:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A52D20268 for ; Tue, 9 Feb 2016 17:18:44 +0000 (UTC) Received: from localhost ([::1]:58532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTBw3-0007ai-Rt for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Feb 2016 12:18:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTBvk-0007Ns-53 for qemu-devel@nongnu.org; Tue, 09 Feb 2016 12:18:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTBvg-0000gB-Rk for qemu-devel@nongnu.org; Tue, 09 Feb 2016 12:18:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTBvg-0000fy-MJ for qemu-devel@nongnu.org; Tue, 09 Feb 2016 12:18:20 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 3A86814CAB1; Tue, 9 Feb 2016 17:18:20 +0000 (UTC) Received: from [10.3.113.29] (ovpn-113-29.phx2.redhat.com [10.3.113.29]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19HIJ7G028562; Tue, 9 Feb 2016 12:18:19 -0500 To: Peter Maydell References: <1455031511-23684-1-git-send-email-peter.maydell@linaro.org> <56BA0F09.8060302@redhat.com> <56BA0F98.2040300@redhat.com> <56BA1D97.5040705@redhat.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <56BA1F5B.3050903@redhat.com> 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 MIME-Version: 1.0 In-Reply-To: <56BA1D97.5040705@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: QEMU Developers , Patch Tracking Subject: Re: [Qemu-devel] [PATCH 00/14] More #include cleanups X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. __attribute__((unused)); 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]