Skip to content

Commit

Permalink
vhost: fix C++ include
Browse files Browse the repository at this point in the history
[ upstream commit 1d1126a ]

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: f8904d5 ("vhost: fix header for strict compilation flags")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
bruce-richardson authored and bluca committed Feb 17, 2022
1 parent b6dd9d6 commit c7bd2f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/librte_vhost/rte_vhost.h
Expand Up @@ -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)
Expand Down

0 comments on commit c7bd2f4

Please sign in to comment.