From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aViaX-0003BA-Uv for qemu-devel@nongnu.org; Tue, 16 Feb 2016 11:34:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aViaW-00077I-SY for qemu-devel@nongnu.org; Tue, 16 Feb 2016 11:34:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aViaW-00077E-Mn for qemu-devel@nongnu.org; Tue, 16 Feb 2016 11:34:56 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 5BA97C0293B6 for ; Tue, 16 Feb 2016 16:34:56 +0000 (UTC) From: Paolo Bonzini Date: Tue, 16 Feb 2016 17:34:23 +0100 Message-Id: <1455640486-6101-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1455640486-6101-1-git-send-email-pbonzini@redhat.com> References: <1455640486-6101-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 05/28] build: Don't redefine 'inline' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Eric Blake Actively redefining 'inline' is wrong for C++, where gcc has an extension 'inline namespace' which fails to compile if the keyword 'inline' is replaced by a macro expansion. This will matter once we start to include "qemu/osdep.h" first from C++ files, depending also on whether the system headers are new enough to be using the gcc extension. But rather than just guard things by __cplusplus, let's look at the overall picture. Commit df2542c737ea2 in 2007 defined 'inline' to the gcc attribute __always_inline__, with the rationale "To avoid discarded inlining bug". But compilers have improved since then, and we are probably better off trusting the compiler rather than trying to force its hand. So just nuke our craziness. Signed-off-by: Eric Blake Message-Id: <1455043788-28112-1-git-send-email-eblake@redhat.com> Reviewed-by: Peter Maydell Signed-off-by: Paolo Bonzini --- include/qemu/compiler.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index d22eb01..c5fbe28 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -77,18 +77,6 @@ #define typeof_field(type, field) typeof(((type *)0)->field) #define type_check(t1,t2) ((t1*)0 - (t2*)0) -#ifndef always_inline -#if !((__GNUC__ < 3) || defined(__APPLE__)) -#ifdef __OPTIMIZE__ -#undef inline -#define inline __attribute__ (( always_inline )) __inline__ -#endif -#endif -#else -#undef inline -#define inline always_inline -#endif - #define QEMU_BUILD_BUG_ON(x) \ typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1] __attribute__((unused)); -- 2.5.0