From: Felipe Huici Date: Mon, 9 Dec 2019 08:19:25 +0000 (+0100) Subject: Make headers compatible with c++ builds X-Git-Tag: RELEASE-0.4~8 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0b1ddb41a69cbf5e7d7bb40c5cfe7b703e6fd52e;p=unikraft%2Flibs%2Flwip.git Make headers compatible with c++ builds Add extern C clauses to header files so that c++ builds do not break. Signed-off-by: Felipe Huici Reviewed-by: Vlad-Andrei Badoiu --- diff --git a/include/arpa/inet.h b/include/arpa/inet.h index a1201a2..c4d01d6 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -1,5 +1,12 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); int inet_pton(int af, const char *src, void *dst); +#ifdef __cplusplus +} +#endif diff --git a/include/netdb.h b/include/netdb.h index 6944c59..7742012 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -2,6 +2,10 @@ #define _LWIP_GLUE_NETDB_H_ #include +#ifdef __cplusplus +extern "C" { +#endif + #if LWIP_DNS && LWIP_SOCKET #if !(LWIP_COMPAT_SOCKETS) @@ -78,5 +82,10 @@ struct servent *getservbyname(const char *name, const char *proto); struct servent *getservbyport(int port, const char *proto); int getservbyport_r(int port, const char *prots, struct servent *se, char *buf, size_t buflen, struct servent **res); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sys/socket.h b/include/sys/socket.h index 3024e17..8007cb8 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -33,6 +33,10 @@ #ifndef _UK_LWIP_SOCKET_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #if CONFIG_HAVE_LIBC #include @@ -97,4 +101,8 @@ int sendto(int s, const void *dataptr, size_t size, int flags, const struct sockaddr *to, socklen_t tolen); int socketpair(int domain, int type, int protocol, int sv[2]); +#ifdef __cplusplus +} +#endif + #endif /* _UK_LWIP_SOCKET_H_ */