]> git.droids-corp.org - dpdk.git/commitdiff
vhost: fix C++ include
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 10 Feb 2022 15:42:38 +0000 (15:42 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 10 Feb 2022 22:05:32 +0000 (23:05 +0100)
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: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
lib/vhost/rte_vhost.h

index b454c05868e1d9f138b577c92cb712d0920a3383..2acb31df2d8ea551412c2c8e76b82b14533dc069 100644 (file)
 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)