diff --git a/components/net/at/at_socket/at_socket.h b/components/net/at/at_socket/at_socket.h index 8e90609082b146ad7c2996159394142f8de4835c..7d9ce91f39dee16140f019aed8c48f92852f4303 100644 --- a/components/net/at/at_socket/at_socket.h +++ b/components/net/at/at_socket/at_socket.h @@ -32,6 +32,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef AT_SOCKET_RECV_BFSZ #define AT_SOCKET_RECV_BFSZ 512 #endif @@ -160,4 +164,8 @@ void at_scoket_device_register(const struct at_device_ops *ops); #endif /* RT_USING_SAL */ +#ifdef __cplusplus +} +#endif + #endif /* AT_SOCKET_H__ */ diff --git a/components/net/at/include/at.h b/components/net/at/include/at.h index d0040f86cfd09dd34ffc212c47b804df7aa04f37..1ef0388a65f67e955671c49e84b62143e17ac5c4 100644 --- a/components/net/at/include/at.h +++ b/components/net/at/include/at.h @@ -27,6 +27,9 @@ #include +#ifdef __cplusplus +extern "C" { +#endif #define AT_SW_VERSION "0.3.0" #define DBG_ENABLE @@ -251,4 +254,8 @@ void at_port_reset(void); void at_port_factory_reset(void); #endif +#ifdef __cplusplus +} +#endif + #endif /* __AT_H__ */ diff --git a/components/net/sal_socket/impl/af_inet.h b/components/net/sal_socket/impl/af_inet.h index 10a77d58710bd433e6539e751020449eac5579e0..8d6be25eaaf6b3d699764b4847e3fb0075e3981f 100644 --- a/components/net/sal_socket/impl/af_inet.h +++ b/components/net/sal_socket/impl/af_inet.h @@ -27,6 +27,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #ifdef SAL_USING_LWIP /* lwIP protocol family register */ int lwip_inet_init(void); @@ -37,4 +41,8 @@ int lwip_inet_init(void); int at_inet_init(void); #endif +#ifdef __cplusplus +} +#endif + #endif /* __AF_INET_H__ */ diff --git a/components/net/sal_socket/include/dfs_net/dfs_net.h b/components/net/sal_socket/include/dfs_net/dfs_net.h index 2a21fe3858b19300e40fdb6d9a44d01a74a74289..242d3c5334f765146fa30cc977d57cc5b6829aa5 100644 --- a/components/net/sal_socket/include/dfs_net/dfs_net.h +++ b/components/net/sal_socket/include/dfs_net/dfs_net.h @@ -26,12 +26,12 @@ #ifndef DFS_NET_H__ #define DFS_NET_H__ +#include + #ifdef __cplusplus extern "C" { #endif -#include - const struct dfs_file_ops* dfs_net_get_fops(void); int dfs_net_getsocket(int fd); diff --git a/components/net/sal_socket/include/sal.h b/components/net/sal_socket/include/sal.h index e1a6dbedba576b47f8be94bd9b793a502cd78de4..62ffaa303efb66888d2d3ff0533dc02ea2c3b74f 100644 --- a/components/net/sal_socket/include/sal.h +++ b/components/net/sal_socket/include/sal.h @@ -28,6 +28,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #if !defined(socklen_t) && !defined(SOCKLEN_T_DEFINED) typedef uint32_t socklen_t; #endif @@ -103,4 +107,8 @@ int sal_proto_family_register(const struct proto_family *pf); int sal_proto_family_unregister(const struct proto_family *pf); struct proto_family *sal_proto_family_find(const char *name); +#ifdef __cplusplus +} +#endif + #endif /* SAL_H__ */ diff --git a/components/net/sal_socket/include/sal_ipaddr.h b/components/net/sal_socket/include/sal_ipaddr.h index 814d1d16e99f29cbdc52f30f8e1250ede13ff0ea..c40fc18374d287cf1990694dd79de54d8e1efe6e 100644 --- a/components/net/sal_socket/include/sal_ipaddr.h +++ b/components/net/sal_socket/include/sal_ipaddr.h @@ -26,6 +26,10 @@ #include "sal_type.h" +#ifdef __cplusplus +extern "C" { +#endif + /** IPv4 only: set the IP address given as an u32_t */ #define ip4_addr_set_u32(dest_ipaddr, src_u32) ((dest_ipaddr)->addr = (src_u32)) /** IPv4 only: get the IP address as an u32_t */ diff --git a/components/net/sal_socket/include/sal_netdb.h b/components/net/sal_socket/include/sal_netdb.h index 12f7abe6b79a441e6b9bde550f01c1c143d11a4d..0a31f26fae227c34e954e75453d54e3854bf63c4 100644 --- a/components/net/sal_socket/include/sal_netdb.h +++ b/components/net/sal_socket/include/sal_netdb.h @@ -26,6 +26,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define EAI_NONAME 200 #define EAI_SERVICE 201 #define EAI_FAIL 202 @@ -88,4 +92,8 @@ int sal_getaddrinfo(const char *nodename, const struct addrinfo *hints, struct addrinfo **res); +#ifdef __cplusplus +} +#endif + #endif /* SAL_NETDB_H__ */ diff --git a/components/net/sal_socket/include/sal_socket.h b/components/net/sal_socket/include/sal_socket.h index 872fd5ca95d8e4039a11c6113f5ad539e8cfe19d..477112392c9a99995f1f5cb760a089879e57fcc4 100644 --- a/components/net/sal_socket/include/sal_socket.h +++ b/components/net/sal_socket/include/sal_socket.h @@ -27,6 +27,10 @@ #include "sal_ipaddr.h" +#ifdef __cplusplus +extern "C" { +#endif + #if !defined(socklen_t) && !defined(SOCKLEN_T_DEFINED) typedef uint32_t socklen_t; #endif @@ -175,4 +179,8 @@ int sal_socket(int domain, int type, int protocol); int sal_closesocket(int socket); int sal_ioctlsocket(int socket, long cmd, void *arg); +#ifdef __cplusplus +} +#endif + #endif /* SAL_SOCKET_H__ */ diff --git a/components/net/sal_socket/include/sal_type.h b/components/net/sal_socket/include/sal_type.h index 0446d5f4e18b2b5932c387e58fdd8edb60ea6a8a..907b3d02b4ec966d11781e5c82eb308feb1eb70f 100644 --- a/components/net/sal_socket/include/sal_type.h +++ b/components/net/sal_socket/include/sal_type.h @@ -28,6 +28,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + typedef int8_t err_t; typedef uint8_t u8_t; typedef int8_t s8_t; @@ -37,4 +41,8 @@ typedef uint32_t u32_t; typedef int32_t s32_t; typedef uintptr_t mem_ptr_t; +#ifdef __cplusplus +} +#endif + #endif /* SAL_TYPE_H__ */ diff --git a/components/net/sal_socket/src/sal_socket.c b/components/net/sal_socket/src/sal_socket.c index 920ce720c213af9025c272c63397a914ac1dc3b9..7b6683a69cd56408d7f2b9761c94572cde5a5b0a 100644 --- a/components/net/sal_socket/src/sal_socket.c +++ b/components/net/sal_socket/src/sal_socket.c @@ -738,7 +738,6 @@ struct hostent *sal_gethostbyname(const char *name) { return hst; } - continue; } } @@ -759,7 +758,6 @@ int sal_gethostbyname_r(const char *name, struct hostent *ret, char *buf, { return res; } - continue; } } @@ -796,7 +794,6 @@ int sal_getaddrinfo(const char *nodename, { return ret; } - continue; } }