From patchwork Mon May 10 12:25:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 433127 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2802011jao; Mon, 10 May 2021 05:40:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvosDq3JPDlFs6jzXc8mydE8S7p8PNaPNTDMVycZcBo9V4tfvKbbIH8zXj6ndPL81SpQ01 X-Received: by 2002:a05:6e02:80b:: with SMTP id u11mr22063919ilm.153.1620650416552; Mon, 10 May 2021 05:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620650416; cv=none; d=google.com; s=arc-20160816; b=QyQmkh2uYYyl7t00WmfUS5Cv9nD3sWtOru1TDgdvrLlCgEstVYmIlrjDfBQ+XrnNe1 K0LjMdMW4eGW0hmLz/DMrXyprD6ozmmpLD5vD5ttoCweOlnOaVpldgHMAuAomvw6yk5w 3mc4sQYPB9p0ZKdOY2+zSXcuVIk27OOWPi22g2J0AFMvQ9p0jdO4PLWnaNAXOHvMbASz rabJczBNyUsRgd6i80OYSTGsjFXEKQ1jgD7o1fdW+PIR586m1ZANq5tVc0p7TcOcwGpF 9jQRssvBy9UbnJh7ty099fYS4h+oBzJSl9pjbSaJqFrPNmQ6UcgI7niZWvqs2/R2h0Rn omlQ== 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=PTv2d7AJ+CSiaH9XIWvIX/fDTG8P2ni/pY19lKB3JJ8=; b=JNNPru7ZKcKdvnkEwdq50T8gwSfh8pY+pIRfHLXsV7XitZOSEooVa683x85kep+NTV Otu4CfgU/zE5j0GQzuSazYhA88PWOYKZHTMMT5/Mo87akd9y8IS94DW6sM0gT21s/spA LOXu24vg7BeaioTbnvPg66bj5ITrr0MwoKuN/dF/9MwteRPevxDkR5tUk0pHoDr9KHXj A03qoRdwFcJHdrAFd/81Xg/QDKAQJZCL0pSE0OMNzIWjFQFbbJebK3DrmrpsKConW6GC fkM9Ucd0wzyQXOA8ECwbvsY7XMz7uuclzXjkZwjJM2v+3PWi75VGMfS/J2bH5tV9/8yA hLKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M9LTFNjv; 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 p2si16577209ilq.68.2021.05.10.05.40.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 May 2021 05:40:16 -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=M9LTFNjv; 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]:57576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lg5Cp-0000cE-VQ for patch@linaro.org; Mon, 10 May 2021 08:40:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg4z9-0006Bh-Iz for qemu-devel@nongnu.org; Mon, 10 May 2021 08:26:07 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:52107) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lg4z6-0003GG-NP for qemu-devel@nongnu.org; Mon, 10 May 2021 08:26:07 -0400 Received: by mail-wm1-x330.google.com with SMTP id n205so9093380wmf.1 for ; Mon, 10 May 2021 05:26:03 -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=PTv2d7AJ+CSiaH9XIWvIX/fDTG8P2ni/pY19lKB3JJ8=; b=M9LTFNjvNVAnihtQWe2WFDBdFpSA6ReEyLMRIEyW5Ip51H4BMAELTrWO4zeYclwI2+ nVcjWmIUYGmhG0ui7sFt842sEHz9NI24SEaS4mcthb3rxwljbZEo11eaBgfOooAdHL8r Kbu16aiMTBVgaNm/jdlo8wf0oE8axUEG3Nvh4wl0wcQ4g/wMY5pFDGrlAY11LsXPA0pN +m6fGQT7Kz5snSqM8LrjgidP+M8zD9gDkewrwisoBAPZxSYVQt6nViy+ZtWYtREPjLCW C77aUVLFFSVh9dgNcJsjEP2KrkUmKrPjt/Aicw5od3N07miw5sOCvzuwX0u1lVTo9ev5 4OuQ== 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=PTv2d7AJ+CSiaH9XIWvIX/fDTG8P2ni/pY19lKB3JJ8=; b=UtSNZCfAITTNLSPms94C6VXhFvlCDFheRI4NQ7ihKwa7DiIAB2JRru3H+LKbtVTvp3 V/U05uFKJBmLdf1exYH1UFhqU+yp9eQHPSCqxh5eOn5IQgPo22Qp+bITcbHHLk0XTE36 TcaBldMxt/6xgBTIry0znpALLkVjkhj8iWZ89B2arvT0M6efukz8gHKDOTgcM8AxSp88 Bzw0WAdpa8sFaZdwHI/9+6vGPTez34KliLttNfQ5Mat/k4N3cMsamyNMQFEjsgajR9uM AsuyL4qflSUwc3Ix7j41XNWnIw7YFklWvWtVWiy0JfoVoUa4EFVxZMaAkZ+/qlDZN/Sk 1PaQ== X-Gm-Message-State: AOAM533v6aP9FuFyz02f1qAbfcSvehusF5kcHB7FH5qxwS2hVGQfUC4h rRDzU7u6kKRkY5IM6cwf5ELQQ4XKYjnxWA== X-Received: by 2002:a05:600c:2296:: with SMTP id 22mr38042134wmf.165.1620649563127; Mon, 10 May 2021 05:26:03 -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.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 05:26:02 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/26] osdep: Make os-win32.h and os-posix.h handle 'extern "C"' themselves Date: Mon, 10 May 2021 13:25:41 +0100 Message-Id: <20210510122548.28638-20-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::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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" Both os-win32.h and os-posix.h include system header files. Instead of having osdep.h include them inside its 'extern "C"' block, make these headers handle that themselves, so that we don't include the system headers inside 'extern "C"'. This doesn't fix any current problems, but it's conceptually the right way to handle system headers. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- include/qemu/osdep.h | 8 ++++---- include/sysemu/os-posix.h | 8 ++++++++ include/sysemu/os-win32.h | 8 ++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index cb2a07e472e..4c6f2390be4 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -131,10 +131,6 @@ QEMU_EXTERN_C int daemon(int, int); */ #include "glib-compat.h" -#ifdef __cplusplus -extern "C" { -#endif - #ifdef _WIN32 #include "sysemu/os-win32.h" #endif @@ -143,6 +139,10 @@ extern "C" { #include "sysemu/os-posix.h" #endif +#ifdef __cplusplus +extern "C" { +#endif + #include "qemu/typedefs.h" /* diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index 629c8c648b7..2edf33658a4 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -38,6 +38,10 @@ #include #endif +#ifdef __cplusplus +extern "C" { +#endif + void os_set_line_buffering(void); void os_set_proc_name(const char *s); void os_setup_signal_handling(void); @@ -92,4 +96,8 @@ static inline void qemu_funlockfile(FILE *f) funlockfile(f); } +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index 5346d51e890..43f569b5c21 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -30,6 +30,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #if defined(_WIN64) /* On w64, setjmp is implemented by _setjmp which needs a second parameter. * If this parameter is NULL, longjump does no stack unwinding. @@ -194,4 +198,8 @@ ssize_t qemu_recv_wrap(int sockfd, void *buf, size_t len, int flags); ssize_t qemu_recvfrom_wrap(int sockfd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *addrlen); +#ifdef __cplusplus +} +#endif + #endif