From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: [PATCH 07/13] net/avp: fix errors in exported headers Date: Mon, 24 Apr 2017 17:53:01 +0200 Message-ID: <5ad16bd561e4a9d7d5a6dfadaccc56d746feb537.1493048352.git.adrien.mazarguil@6wind.com> References: Cc: Allain Legacy To: dev@dpdk.org Return-path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id A5D0B5A6A for ; Mon, 24 Apr 2017 17:53:26 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id i137so6182197wmf.0 for ; Mon, 24 Apr 2017 08:53:26 -0700 (PDT) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit addresses several errors related to missing includes such as: In file included from /tmp/check-includes.sh.15315.c:1:0: build/include/rte_avp_fifo.h:77:22: error: 'struct rte_avp_fifo' declared inside parameter list [-Werror] [...] build/include/rte_avp_fifo.h: In function 'avp_fifo_init': build/include/rte_avp_fifo.h:81:3: error: implicit declaration of function 'rte_panic' [-Werror=implicit-function-declaration] [...] build/include/rte_avp_fifo.h:83:6: error: dereferencing pointer to incomplete type [...] build/include/rte_avp_fifo.h:109:2: error: implicit declaration of function 'rte_wmb' [-Werror=implicit-function-declaration] [...] In file included from /tmp/check-includes.sh.15315.c:1:0: build/include/rte_avp_common.h:104:2: error: unknown type name 'uint64_t' [...] build/include/rte_avp_common.h:386:15: error: 'ETHER_ADDR_LEN' undeclared here (not in a function) [...] It addresses errors with strict compilation flags: In file included from /tmp/check-includes.sh.15315.c:1:0: build/include/rte_avp_common.h:122:3: error: ISO C99 doesn't support unnamed structs/unions [-Werror=pedantic] [...] build/include/rte_avp_common.h:136:17: error: ISO C forbids zero-size array 'buffer' [-Werror=pedantic] [...] And also adds C++ awareness to both header files. Fixes: 8e680655e205 ("net/avp: add public header files") Cc: Allain Legacy Signed-off-by: Adrien Mazarguil --- drivers/net/avp/rte_avp_common.h | 16 +++++++++++++++- drivers/net/avp/rte_avp_fifo.h | 12 ++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/net/avp/rte_avp_common.h b/drivers/net/avp/rte_avp_common.h index 31d763e..6cdaca9 100644 --- a/drivers/net/avp/rte_avp_common.h +++ b/drivers/net/avp/rte_avp_common.h @@ -57,9 +57,18 @@ #ifndef _RTE_AVP_COMMON_H_ #define _RTE_AVP_COMMON_H_ +#include #ifdef __KERNEL__ #include #endif +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /** * AVP name is part of network device name. @@ -115,6 +124,7 @@ struct rte_avp_device_config { */ struct rte_avp_request { uint32_t req_id; /**< Request id */ + RTE_STD_C11 union { uint32_t new_mtu; /**< New MTU */ uint8_t if_up; /**< 1: interface up, 0: interface down */ @@ -133,7 +143,7 @@ struct rte_avp_fifo { volatile unsigned int read; /**< Next position to be read */ unsigned int len; /**< Circular buffer length */ unsigned int elem_size; /**< Pointer size - for 32/64 bit OS */ - void *volatile buffer[0]; /**< The buffer contains mbuf pointers */ + void *volatile buffer[]; /**< The buffer contains mbuf pointers */ }; @@ -413,4 +423,8 @@ struct rte_avp_device_info { #define RTE_AVP_IOCTL_RELEASE _IOWR(0, 3, struct rte_avp_device_info) #define RTE_AVP_IOCTL_QUERY _IOWR(0, 4, struct rte_avp_device_config) +#ifdef __cplusplus +} +#endif + #endif /* _RTE_AVP_COMMON_H_ */ diff --git a/drivers/net/avp/rte_avp_fifo.h b/drivers/net/avp/rte_avp_fifo.h index 8262e4f..a0a37eb 100644 --- a/drivers/net/avp/rte_avp_fifo.h +++ b/drivers/net/avp/rte_avp_fifo.h @@ -57,6 +57,12 @@ #ifndef _RTE_AVP_FIFO_H_ #define _RTE_AVP_FIFO_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + #ifdef __KERNEL__ /* Write memory barrier for kernel compiles */ #define AVP_WMB() smp_wmb() @@ -70,6 +76,8 @@ #endif #ifndef __KERNEL__ +#include + /** * Initializes the avp fifo structure */ @@ -154,4 +162,8 @@ avp_fifo_free_count(struct rte_avp_fifo *fifo) return (fifo->read - fifo->write - 1) & (fifo->len - 1); } +#ifdef __cplusplus +} +#endif + #endif /* _RTE_AVP_FIFO_H_ */ -- 2.1.4