add 'extern "C" {}' for cplusplus in many headers

This commit is contained in:
Simon Goldschmidt 2018-07-19 22:05:43 +02:00
parent 633205ba78
commit 5bef7ea72f
15 changed files with 108 additions and 5 deletions

View File

@ -47,6 +47,10 @@
#include "lwip/ip_addr.h"
#ifdef __cplusplus
extern "C" {
#endif
struct altcp_proxyconnect_config {
ip_addr_t proxy_addr;
u16_t proxy_port;
@ -67,5 +71,9 @@ struct altcp_proxyconnect_tls_config {
struct altcp_pcb *altcp_proxyconnect_tls_alloc(void *arg, u8_t ip_type);
#endif /* LWIP_ALTCP_TLS */
#ifdef __cplusplus
}
#endif
#endif /* LWIP_ALTCP */
#endif /* LWIP_HDR_APPS_ALTCP_PROXYCONNECT_H */

View File

@ -41,6 +41,10 @@
#include "lwip/apps/mdns_opts.h"
#include "lwip/netif.h"
#ifdef __cplusplus
extern "C" {
#endif
#if LWIP_MDNS_RESPONDER
enum mdns_sd_proto {
@ -94,4 +98,8 @@ void mdns_resp_announce(struct netif *netif);
#endif /* LWIP_MDNS_RESPONDER */
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_APPS_MDNS_H */

View File

@ -40,6 +40,10 @@
#include "lwip/apps/mdns_opts.h"
#include "lwip/pbuf.h"
#ifdef __cplusplus
extern "C" {
#endif
#if LWIP_MDNS_RESPONDER
/* Domain struct and methods - visible for unit tests */
@ -63,4 +67,8 @@ u16_t mdns_compress_domain(struct pbuf *pbuf, u16_t *offset, struct mdns_domain
#endif /* LWIP_MDNS_RESPONDER */
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_MDNS_PRIV_H */

View File

@ -34,10 +34,18 @@
#include "lwip/apps/netbiosns_opts.h"
#ifdef __cplusplus
extern "C" {
#endif
void netbiosns_init(void);
#ifndef NETBIOS_LWIP_NAME
void netbiosns_set_name(const char* hostname);
#endif
void netbiosns_stop(void);
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_APPS_NETBIOS_H */

View File

@ -1,6 +1,10 @@
#ifndef LWIP_HDR_APPS_SMTP_H
#define LWIP_HDR_APPS_SMTP_H
#ifdef __cplusplus
extern "C" {
#endif
#include "lwip/apps/smtp_opts.h"
#include "lwip/err.h"
#include "lwip/prot/iana.h"
@ -117,4 +121,8 @@ void smtp_send_mail_int(void *arg);
const char* smtp_result_str(u8_t smtp_result);
#endif
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_APPS_SMTP_H */

View File

@ -72,7 +72,7 @@ extern "C" {
/**
* @}
*/
#ifdef __cplusplus
}
#endif

View File

@ -38,23 +38,27 @@
#include "lwip/apps/snmp_opts.h"
#include "lwip/err.h"
#ifdef __cplusplus
extern "C" {
#endif
#if LWIP_SNMP && LWIP_SNMP_V3
typedef enum
typedef enum
{
SNMP_V3_AUTH_ALGO_INVAL = 0,
SNMP_V3_AUTH_ALGO_MD5 = 1,
SNMP_V3_AUTH_ALGO_SHA = 2
} snmpv3_auth_algo_t;
typedef enum
typedef enum
{
SNMP_V3_PRIV_ALGO_INVAL = 0,
SNMP_V3_PRIV_ALGO_DES = 1,
SNMP_V3_PRIV_ALGO_AES = 2
} snmpv3_priv_algo_t;
typedef enum
typedef enum
{
SNMP_V3_USER_STORAGETYPE_OTHER = 1,
SNMP_V3_USER_STORAGETYPE_VOLATILE = 2,
@ -103,4 +107,8 @@ void snmpv3_password_to_key_sha(
#endif
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_APPS_SNMP_V3_H */

View File

@ -47,6 +47,10 @@
#include "lwip/err.h"
#include "lwip/netif.h"
#ifdef __cplusplus
extern "C" {
#endif
/** period (in milliseconds) of the application calling dhcp6_tmr() */
#define DHCP6_TIMER_MSECS 500
@ -91,6 +95,10 @@ extern void dhcp6_set_ntp_servers(u8_t num_ntp_servers, const ip_addr_t* ntp_ser
#define netif_dhcp6_data(netif) ((struct dhcp6*)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP6))
#ifdef __cplusplus
}
#endif
#endif /* LWIP_IPV6_DHCP6 */
#endif /* LWIP_HDR_IP6_DHCP6_H */

View File

@ -85,6 +85,10 @@
#ifndef LWIP_HDR_IP6_ZONE_H
#define LWIP_HDR_IP6_ZONE_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup ip6_zones IPv6 Zones
* @ingroup ip6
@ -293,4 +297,8 @@ enum lwip_ipv6_scope_type
#endif /* LWIP_IPV6 */
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_IP6_ZONE_H */

View File

@ -41,6 +41,10 @@
#ifndef LWIP_HDR_PROT_IANA_H
#define LWIP_HDR_PROT_IANA_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @ingroup iana
* Hardware types
@ -86,4 +90,8 @@ enum lwip_iana_port_number {
LWIP_IANA_PORT_SECURE_MQTT = 8883
};
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_PROT_IANA_H */

View File

@ -41,6 +41,10 @@
#ifndef LWIP_HDR_PROT_IEEE_H
#define LWIP_HDR_PROT_IEEE_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @ingroup ieee
* A list of often ethtypes (although lwIP does not use all of them).
@ -80,4 +84,8 @@ enum lwip_ieee_eth_type {
ETHTYPE_QINQ = 0x9100U
};
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_PROT_IEEE_H */

View File

@ -39,6 +39,10 @@
#include "lwip/arch.h"
#ifdef __cplusplus
extern "C" {
#endif
#define IP_PROTO_ICMP 1
#define IP_PROTO_IGMP 2
#define IP_PROTO_UDP 17
@ -48,4 +52,8 @@
/** This operates on a void* by loading the first byte */
#define IP_HDR_GET_VERSION(ptr) ((*(u8_t*)(ptr)) >> 4)
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_PROT_IP_H */

View File

@ -43,7 +43,7 @@
#ifdef __cplusplus
extern "C" {
#endif
/** This is the packed version of ip6_addr_t,
used in network headers that are itself packed */
#ifdef PACK_STRUCT_USE_INCLUDES

View File

@ -42,6 +42,10 @@
#include "lwip/err.h"
#include "lwip/prot/ethernet.h"
#ifdef __cplusplus
extern "C" {
#endif
struct netif;
#if (BRIDGEIF_MAX_PORTS < 0) || (BRIDGEIF_MAX_PORTS >= 64)
@ -116,4 +120,8 @@ void* bridgeif_fdb_init(u16_t max_fdb_entries);
#define BRIDGEIF_WRITE_UNPROTECT(lev)
#endif /* BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT */
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_NETIF_BRIDGEIF_H */

View File

@ -39,6 +39,10 @@
#include "lwip/opt.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/bpstruct.h"
#endif
@ -101,5 +105,8 @@ PACK_STRUCT_END
#define IEEE_802154_FC_SRC_ADDR_MODE_SHORT (IEEE_802154_ADDR_MODE_SHORT << 14)
#define IEEE_802154_FC_SRC_ADDR_MODE_EXT (IEEE_802154_ADDR_MODE_EXT << 14)
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_NETIF_IEEE802154_H */