From 68ced8035d9cec46b39175bad6e0641daf9fea7b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Mon, 24 Jul 2017 16:23:14 +0300 Subject: [PATCH] net: Add missing __cplusplus checks to includes Some of the public networking include files did not had __cplusplus checks. Signed-off-by: Jukka Rissanen --- include/net/arp.h | 8 ++++++++ include/net/dhcpv4.h | 8 ++++++++ include/net/dns_resolve.h | 8 ++++++++ include/net/ethernet.h | 8 ++++++++ include/net/http.h | 8 ++++++++ include/net/ieee802154.h | 8 ++++++++ include/net/ieee802154_radio.h | 8 ++++++++ include/net/mqtt.h | 8 ++++++++ include/net/mqtt_types.h | 8 ++++++++ include/net/net_event.h | 8 ++++++++ include/net/net_mgmt.h | 8 ++++++++ include/net/zoap.h | 8 ++++++++ include/net/zoap_link_format.h | 8 ++++++++ 13 files changed, 104 insertions(+) diff --git a/include/net/arp.h b/include/net/arp.h index 2a2673699c1..5ffc507c780 100644 --- a/include/net/arp.h +++ b/include/net/arp.h @@ -13,6 +13,10 @@ #ifndef __ARP_H #define __ARP_H +#ifdef __cplusplus +extern "C" { +#endif + #if defined(CONFIG_NET_ARP) #include @@ -49,4 +53,8 @@ void net_arp_init(void); #endif /* CONFIG_NET_ARP */ +#ifdef __cplusplus +} +#endif + #endif /* __ARP_H */ diff --git a/include/net/dhcpv4.h b/include/net/dhcpv4.h index 900283b1196..8ce84c114ff 100644 --- a/include/net/dhcpv4.h +++ b/include/net/dhcpv4.h @@ -11,6 +11,10 @@ #ifndef __DHCPV4_H #define __DHCPV4_H +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief DHCPv4 * @defgroup dhcpv4 DHCPv4 @@ -68,4 +72,8 @@ const char *net_dhcpv4_state_name(enum net_dhcpv4_state state); * @} */ +#ifdef __cplusplus +} +#endif + #endif /* __DHCPV4_H */ diff --git a/include/net/dns_resolve.h b/include/net/dns_resolve.h index 6457c45ae6e..14dfb58b085 100644 --- a/include/net/dns_resolve.h +++ b/include/net/dns_resolve.h @@ -16,6 +16,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief DNS resolving library * @defgroup dns_resolve DNS Resolve Library @@ -320,4 +324,8 @@ void dns_init_resolver(void); #define dns_init_resolver(...) #endif /* CONFIG_DNS_RESOLVER */ +#ifdef __cplusplus +} +#endif + #endif /* _DNS_RESOLVE_H */ diff --git a/include/net/ethernet.h b/include/net/ethernet.h index 3bb90ae78e8..8bb6b655cb3 100644 --- a/include/net/ethernet.h +++ b/include/net/ethernet.h @@ -20,6 +20,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define NET_ETH_HDR(pkt) ((struct net_eth_hdr *)net_pkt_ll(pkt)) #define NET_ETH_PTYPE_ARP 0x0806 @@ -64,4 +68,8 @@ static inline bool net_eth_is_addr_multicast(struct net_eth_addr *addr) const struct net_eth_addr *net_eth_broadcast_addr(void); +#ifdef __cplusplus +} +#endif + #endif /* __ETHERNET_H */ diff --git a/include/net/http.h b/include/net/http.h index 91038daf210..a0527de3b66 100644 --- a/include/net/http.h +++ b/include/net/http.h @@ -9,6 +9,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #if defined(CONFIG_HTTPS) #if defined(CONFIG_MBEDTLS) #if !defined(CONFIG_MBEDTLS_CFG_FILE) @@ -1048,4 +1052,8 @@ int http_response_404(struct http_server_ctx *ctx, const char *html_payload); #endif /* CONFIG_HTTP_SERVER */ +#ifdef __cplusplus +} +#endif + #endif /* __HTTP_H__ */ diff --git a/include/net/ieee802154.h b/include/net/ieee802154.h index 1409b869724..882f1f79fd0 100644 --- a/include/net/ieee802154.h +++ b/include/net/ieee802154.h @@ -15,6 +15,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define IEEE802154_MAX_ADDR_LENGTH 8 struct ieee802154_security_ctx { @@ -254,4 +258,8 @@ struct ieee802154_security_params { u8_t _unused : 3; }; +#ifdef __cplusplus +} +#endif + #endif /* __IEEE802154_H__ */ diff --git a/include/net/ieee802154_radio.h b/include/net/ieee802154_radio.h index a08c20776f6..7368e771764 100644 --- a/include/net/ieee802154_radio.h +++ b/include/net/ieee802154_radio.h @@ -15,6 +15,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + struct ieee802154_radio_api { /** * Mandatory to get in first position. @@ -91,4 +95,8 @@ extern enum net_verdict ieee802154_radio_handle_ack(struct net_if *iface, */ void ieee802154_init(struct net_if *iface); +#ifdef __cplusplus +} +#endif + #endif /* __IEEE802154_RADIO_H__ */ diff --git a/include/net/mqtt.h b/include/net/mqtt.h index a462b771b54..0e49f1ff222 100644 --- a/include/net/mqtt.h +++ b/include/net/mqtt.h @@ -10,6 +10,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief MQTT library * @defgroup mqtt MQTT library @@ -418,4 +422,8 @@ int mqtt_rx_publish(struct mqtt_ctx *ctx, struct net_buf *rx); * @} */ +#ifdef __cplusplus +} #endif + +#endif /* _MQTT_H_ */ diff --git a/include/net/mqtt_types.h b/include/net/mqtt_types.h index cdc6fae7e01..b51f83a7177 100644 --- a/include/net/mqtt_types.h +++ b/include/net/mqtt_types.h @@ -9,6 +9,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief MQTT library * @defgroup mqtt MQTT library @@ -86,4 +90,8 @@ struct mqtt_publish_msg { * @} */ +#ifdef __cplusplus +} #endif + +#endif /* _MQTT_TYPES_H_ */ diff --git a/include/net/net_event.h b/include/net/net_event.h index 7a226773120..e4038525098 100644 --- a/include/net/net_event.h +++ b/include/net/net_event.h @@ -12,6 +12,10 @@ #ifndef __NET_EVENT_H__ #define __NET_EVENT_H__ +#ifdef __cplusplus +extern "C" { +#endif + /* Network Interface events */ #define _NET_IF_LAYER NET_MGMT_LAYER_L1 #define _NET_IF_CORE_CODE 0x001 @@ -121,4 +125,8 @@ enum net_event_ipv4_cmd { #define NET_EVENT_IPV4_ROUTER_ADD \ (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD) +#ifdef __cplusplus +} +#endif + #endif /* __NET_EVENT_H__ */ diff --git a/include/net/net_mgmt.h b/include/net/net_mgmt.h index 7be0679b476..cb2bc38bab5 100644 --- a/include/net/net_mgmt.h +++ b/include/net/net_mgmt.h @@ -12,6 +12,10 @@ #ifndef __NET_MGMT_H__ #define __NET_MGMT_H__ +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Network Management * @defgroup net_mgmt Network Management @@ -264,4 +268,8 @@ static inline int net_mgmt_event_wait_on_iface(struct net_if *iface, * @} */ +#ifdef __cplusplus +} +#endif + #endif /* __NET_MGMT_H__ */ diff --git a/include/net/zoap.h b/include/net/zoap.h index 19357daa577..63de7635994 100644 --- a/include/net/zoap.h +++ b/include/net/zoap.h @@ -20,6 +20,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief COAP library * @defgroup zoap COAP Library @@ -811,4 +815,8 @@ u8_t *zoap_next_token(void); * @} */ +#ifdef __cplusplus +} +#endif + #endif /* __ZOAP_H__ */ diff --git a/include/net/zoap_link_format.h b/include/net/zoap_link_format.h index 670d4937053..5583ea530f5 100644 --- a/include/net/zoap_link_format.h +++ b/include/net/zoap_link_format.h @@ -13,6 +13,10 @@ #ifndef __LINK_FORMAT_H__ #define __LINK_FORMAT_H__ +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief COAP library * @defgroup zoap COAP Library @@ -49,4 +53,8 @@ struct zoap_core_metadata { * @} */ +#ifdef __cplusplus +} +#endif + #endif /* __LINK_FORMAT_H__ */