From patchwork Mon May 10 12:25:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 433125 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2801716jao; Mon, 10 May 2021 05:39:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAdNTS2Psh2uxv2Z2XKeQGq7FEvrDnD7IW8u6q050fVc8W9XZ9Mjlpf+KU5TvohFc4wIkK X-Received: by 2002:a6b:7c0b:: with SMTP id m11mr18033729iok.9.1620650387815; Mon, 10 May 2021 05:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620650387; cv=none; d=google.com; s=arc-20160816; b=V18Wn7pgFEVl39jE8LPn6UocmPSZRpY6695oHp+YPfe2rJl7b+7QItqKMNdZQzMTLI 5izvOqaSibomTKvEKqs7v/6F+rFm3D2XIUfgTun5S7jVKlvPWg9TdRp+cNY6w2jng5Hf tHns0DgBCA4hXsQCrQym0U3oGNv3zJd9WjwRrp4kW1/esWwegR4jc3xCTsM3CvMPPQzX jIXaq8BR8U2mZXfp3GxTnjHX4RXcVvuXHNhGvRwDilsmWFYFJvCyVss3NNHcSWXXft3Q 7GeY89VLu3Ic9wgw1pKUFqxYeov5BmmhDHSBpwkO2oM1h2eegZoTyshyofJPqJFiTnXv x+Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=OR9pef3HduyOmvWH82pNcRMO4dLmxiN0+TVKetu9P78=; b=bhWE7YYMOBvra7yGGGfsJEErB8lnpMCEU8C+DyigjjlcrPP+pJfUsT8X5EpsV9Xkpe io+26Z7TZ10p/AdSz0Rwd2kcbaBVKVCaa1YinlvPdF+n/udhRn0HUMVvkhvY21Q50hcU AebCDgyMtBiyDZZBzqlJBXr4Vf8o9rtqgKbOlmtW7EJ2q2wFcYHxH8+Sh1gvs5AZ+PhQ 4VEQwheBLYOiH1Vw7RetFi4pDCHSOyCSrladECGAUVS9mxGbrUkHczheM553MTBNmzph 7sx3KzUu2RbO/buEEFjVaClGklXEId+DqSvch+ylsF6M4cJmQ2M6wFCiGWGO1Tu7EOKI GHNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K2oagKTx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g2si4227273jam.93.2021.05.10.05.39.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 May 2021 05:39:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K2oagKTx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lg5CN-0000yf-80 for patch@linaro.org; Mon, 10 May 2021 08:39:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg4zB-0006JR-NX for qemu-devel@nongnu.org; Mon, 10 May 2021 08:26:09 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:40554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lg4z7-0003HB-On for qemu-devel@nongnu.org; Mon, 10 May 2021 08:26:09 -0400 Received: by mail-wm1-x32d.google.com with SMTP id y124-20020a1c32820000b029010c93864955so11040499wmy.5 for ; Mon, 10 May 2021 05:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=OR9pef3HduyOmvWH82pNcRMO4dLmxiN0+TVKetu9P78=; b=K2oagKTxhtSLw/i+ufp40hNXRveWuaKvXfLyPvThCK4+y+etStfDhYHtnKG8wmNYae DRfOxLcjRT65ICBMUWRgismjDoMS51EkcDOGJ8ZTInfgM8CPgf6xeXggiFJNAZ9O4+Lb zgVswkzGr2eH4sQMX8fdoBdRnw496zNcQH+v/BV3DOslysj7HgYaTa+ZKhQa06Wqlk2/ cvXyBvWWXdUN0KWMmpsVOmFACa9CFFBXuDRefk8svl5S63uSMAWzPmoRPjGPltIzrAj+ Fdda1xXaaLxwF72WGW26uxtHqZv6VQilmjKsczznyXRqlzECyPNBbD9WnZD/VZ72NRAi MhRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OR9pef3HduyOmvWH82pNcRMO4dLmxiN0+TVKetu9P78=; b=lyAsWaeIE8ByavexHsuHYqKGVVQJ8RUs9r1A7IZEPmRcDxgV1spqff0WzP9xXMM9qB ZBy0tAQ848gjbDzyIsXzY5hnnS/H81dsA8jUpx2YJ5gd1KQFi62/czr4oZkdC8vXwPAz cW/4L23F+u/SR97GHoGDMMvUjpZPjMH/Xj2otLnyMTTnp1P/mWeIxP96DcDGTYr/AtvT CkFQR2lHTHppt3rk0i//xyuUsOVo7Q+BA/dw0Chhzq2+WrRf6BIUHtJ7Rw4/wrYblqZs n0MrENOjpS/OTKTzGjToYLD17gukeL0Qzbseacl0WAEG5ZFHzo7R5J5vEIknOv8iqdEd +gwg== X-Gm-Message-State: AOAM531icx+FKLXA/mtvg/6U4U1E95QF9Rwgipt7WORABg0ysWjfFSl2 xUQXMTkr8zit8buMYFe1pQ87yaoQHrHeWQ== X-Received: by 2002:a05:600c:4998:: with SMTP id h24mr36808508wmp.10.1620649564379; Mon, 10 May 2021 05:26:04 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id d9sm22749897wrp.47.2021.05.10.05.26.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 05:26:04 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 21/26] include/disas/dis-asm.h: Handle being included outside 'extern "C"' Date: Mon, 10 May 2021 13:25:43 +0100 Message-Id: <20210510122548.28638-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210510122548.28638-1-peter.maydell@linaro.org> References: <20210510122548.28638-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Make dis-asm.h handle being included outside an 'extern "C"' block; this allows us to remove the 'extern "C"' blocks that our two C++ files that include it are using. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- include/disas/dis-asm.h | 12 ++++++++++-- disas/arm-a64.cc | 2 -- disas/nanomips.cpp | 2 -- 3 files changed, 10 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h index 13fa1edd411..4701445e806 100644 --- a/include/disas/dis-asm.h +++ b/include/disas/dis-asm.h @@ -9,6 +9,12 @@ #ifndef DISAS_DIS_ASM_H #define DISAS_DIS_ASM_H +#include "qemu/bswap.h" + +#ifdef __cplusplus +extern "C" { +#endif + typedef void *PTR; typedef uint64_t bfd_vma; typedef int64_t bfd_signed_vma; @@ -479,8 +485,6 @@ bool cap_disas_plugin(disassemble_info *info, uint64_t pc, size_t size); /* from libbfd */ -#include "qemu/bswap.h" - static inline bfd_vma bfd_getl64(const bfd_byte *addr) { return ldq_le_p(addr); @@ -508,4 +512,8 @@ static inline bfd_vma bfd_getb16(const bfd_byte *addr) typedef bool bfd_boolean; +#ifdef __cplusplus +} +#endif + #endif /* DISAS_DIS_ASM_H */ diff --git a/disas/arm-a64.cc b/disas/arm-a64.cc index 27613d4b256..a1402a2e071 100644 --- a/disas/arm-a64.cc +++ b/disas/arm-a64.cc @@ -18,9 +18,7 @@ */ #include "qemu/osdep.h" -extern "C" { #include "disas/dis-asm.h" -} #include "vixl/a64/disasm-a64.h" diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp index 8ddef897f0d..9be8df75dd6 100644 --- a/disas/nanomips.cpp +++ b/disas/nanomips.cpp @@ -28,9 +28,7 @@ */ #include "qemu/osdep.h" -extern "C" { #include "disas/dis-asm.h" -} #include #include