From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 81CBFA00C2;
	Thu, 10 Feb 2022 13:04:05 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 771CA426F6;
	Thu, 10 Feb 2022 13:03:58 +0100 (CET)
Received: from mga07.intel.com (mga07.intel.com [134.134.136.100])
 by mails.dpdk.org (Postfix) with ESMTP id 23D594013F;
 Thu, 10 Feb 2022 13:03:56 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
 t=1644494637; x=1676030637;
 h=from:to:cc:subject:date:message-id:in-reply-to:
 references:mime-version:content-transfer-encoding;
 bh=veIxnvD4HcP71geTR9XiNe9UbAQ5n7+OKC29V7i55zI=;
 b=D47bmeaYyQVxDjqacQei4VGhk0dHtTgqW61EwBbhxahDOvpkraX3vCVL
 um7ecYwxWLt9ew1n7l1L/Wz4tMfA47/iKGSjLDxIxHpt1YzrqYfxrDwRd
 i2bOWNr4TcMjmU/IGfhXwqM2Gf8VcSsgbwiSEkV/sX4RNyLmNgvJcW7SC
 pwytVDVICxQis+idEGiQJij6J99MTFIyyZeEiHBzd93R2MoUJimXJ4E5o
 n4HHEsRBrefPdyGGdOkygJpP6IHj/8d3Tz3MQseNwS6gq0TQPEMGf7ESR
 9T8agRcv/nlPAsZsw1nq9Wk7Qi9vKYDhipCe/dsaykSsTxU4mqOlUI55t Q==;
X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="312761755"
X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="312761755"
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 10 Feb 2022 04:03:56 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="622658341"
Received: from silpixa00399126.ir.intel.com ([10.237.223.162])
 by FMSMGA003.fm.intel.com with ESMTP; 10 Feb 2022 04:03:54 -0800
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>, adrien.mazarguil@6wind.com,
 stable@dpdk.org, Yuanhan Liu <yuanhan.liu@linux.intel.com>,
 Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [PATCH v2 6/7] vhost: fix incompatible header includes for C++
Date: Thu, 10 Feb 2022 12:02:56 +0000
Message-Id: <20220210120257.585822-7-bruce.richardson@intel.com>
X-Mailer: git-send-email 2.32.0
In-Reply-To: <20220210120257.585822-1-bruce.richardson@intel.com>
References: <20220204174209.440207-1-bruce.richardson@intel.com>
 <20220210120257.585822-1-bruce.richardson@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

The virtio kernel header includes are already noted as being
incompatible with C++. We can ensure that the header is safe for
inclusion in C++ code by not including those headers during C++ builds.
While not ideal, this does ensure that all DPDK headers can be included
in C++ code without errors.

Fixes: f8904d563691 ("vhost: fix header for strict compilation flags")
Cc: adrien.mazarguil@6wind.com
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/vhost/rte_vhost.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h
index b454c05868..2acb31df2d 100644
--- a/lib/vhost/rte_vhost.h
+++ b/lib/vhost/rte_vhost.h
@@ -21,10 +21,12 @@
 extern "C" {
 #endif
 
+#ifndef __cplusplus
 /* These are not C++-aware. */
 #include <linux/vhost.h>
 #include <linux/virtio_ring.h>
 #include <linux/virtio_net.h>
+#endif
 
 #define RTE_VHOST_USER_CLIENT		(1ULL << 0)
 #define RTE_VHOST_USER_NO_RECONNECT	(1ULL << 1)
-- 
2.32.0