esp_netif: added missing C++ guards

Closes https://github.com/espressif/esp-idf/issues/4389
This commit is contained in:
David Cermak
2019-11-22 09:40:54 +01:00
parent e4f641f5a9
commit c5a6bc9985
6 changed files with 50 additions and 0 deletions

View File

@@ -22,6 +22,10 @@
#include "esp_netif_types.h" #include "esp_netif_types.h"
#include "esp_netif_defaults.h" #include "esp_netif_defaults.h"
#ifdef __cplusplus
extern "C" {
#endif
// //
// Note: tcpip_adapter legacy API has to be included by default to provide full compatibility // Note: tcpip_adapter legacy API has to be included by default to provide full compatibility
// for applications that used tcpip_adapter API without explicit inclusion of tcpip_adapter.h // for applications that used tcpip_adapter API without explicit inclusion of tcpip_adapter.h
@@ -736,4 +740,8 @@ size_t esp_netif_get_nr_of_ifs(void);
* @} * @}
*/ */
#ifdef __cplusplus
}
#endif
#endif /* _ESP_NETIF_H_ */ #endif /* _ESP_NETIF_H_ */

View File

@@ -15,6 +15,10 @@
#ifndef _ESP_NETIF_DEFAULTS_H #ifndef _ESP_NETIF_DEFAULTS_H
#define _ESP_NETIF_DEFAULTS_H #define _ESP_NETIF_DEFAULTS_H
#ifdef __cplusplus
extern "C" {
#endif
// //
// Macros to assemble master configs with partial configs from netif, stack and driver // Macros to assemble master configs with partial configs from netif, stack and driver
// //
@@ -85,4 +89,8 @@ extern const esp_netif_inherent_config_t _g_esp_netif_inherent_sta_config;
extern const esp_netif_inherent_config_t _g_esp_netif_inherent_ap_config; extern const esp_netif_inherent_config_t _g_esp_netif_inherent_ap_config;
extern const esp_netif_inherent_config_t _g_esp_netif_inherent_eth_config; extern const esp_netif_inherent_config_t _g_esp_netif_inherent_eth_config;
#ifdef __cplusplus
}
#endif
#endif //_ESP_NETIF_DEFAULTS_H #endif //_ESP_NETIF_DEFAULTS_H

View File

@@ -16,6 +16,11 @@
#define _ESP_NETIF_IP_ADDR_H_ #define _ESP_NETIF_IP_ADDR_H_
#include <machine/endian.h> #include <machine/endian.h>
#ifdef __cplusplus
extern "C" {
#endif
#if BYTE_ORDER == BIG_ENDIAN #if BYTE_ORDER == BIG_ENDIAN
#define esp_netif_htonl(x) ((uint32_t)(x)) #define esp_netif_htonl(x) ((uint32_t)(x))
#else #else
@@ -95,4 +100,8 @@ typedef struct _ip_addr {
uint8_t type; uint8_t type;
} esp_ip_addr_t; } esp_ip_addr_t;
#ifdef __cplusplus
}
#endif
#endif //_ESP_NETIF_IP_ADDR_H_ #endif //_ESP_NETIF_IP_ADDR_H_

View File

@@ -15,6 +15,10 @@
#ifndef _ESP_NETIF_NET_STACK_H_ #ifndef _ESP_NETIF_NET_STACK_H_
#define _ESP_NETIF_NET_STACK_H_ #define _ESP_NETIF_NET_STACK_H_
#ifdef __cplusplus
extern "C" {
#endif
// //
// Network stack API: This ESP-NETIF API are supposed to be called only from internals of TCP/IP stack // Network stack API: This ESP-NETIF API are supposed to be called only from internals of TCP/IP stack
// //
@@ -76,4 +80,8 @@ void esp_netif_free_rx_buffer(void *esp_netif, void* buffer);
* @} * @}
*/ */
#ifdef __cplusplus
}
#endif
#endif //_ESP_NETIF_NET_STACK_H_ #endif //_ESP_NETIF_NET_STACK_H_

View File

@@ -17,6 +17,10 @@
#include "esp_netif_types.h" #include "esp_netif_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief station list info element * @brief station list info element
*/ */
@@ -59,4 +63,9 @@ esp_err_t esp_netif_get_sta_list(const wifi_sta_list_t *wifi_sta_list, esp_netif
/** /**
* @} * @}
*/ */
#ifdef __cplusplus
}
#endif
#endif //_ESP_NETIF_STA_LIST_H_ #endif //_ESP_NETIF_STA_LIST_H_

View File

@@ -15,6 +15,10 @@
#ifndef _ESP_NETIF_TYPES_H_ #ifndef _ESP_NETIF_TYPES_H_
#define _ESP_NETIF_TYPES_H_ #define _ESP_NETIF_TYPES_H_
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Definition of ESP-NETIF based errors * @brief Definition of ESP-NETIF based errors
*/ */
@@ -198,4 +202,8 @@ struct esp_netif_config {
*/ */
typedef esp_err_t (*esp_netif_receive_t)(esp_netif_t *esp_netif, void *buffer, size_t len, void *eb); typedef esp_err_t (*esp_netif_receive_t)(esp_netif_t *esp_netif, void *buffer, size_t len, void *eb);
#ifdef __cplusplus
}
#endif
#endif // _ESP_NETIF_TYPES_H_ #endif // _ESP_NETIF_TYPES_H_