]> xenbits.xensource.com Git - unikraft/libs/lwip.git/commitdiff
Make headers compatible with c++ builds
authorFelipe Huici <felipe.huici@neclab.eu>
Mon, 9 Dec 2019 08:19:25 +0000 (09:19 +0100)
committerFelipe Huici <felipe.huici@neclab.eu>
Thu, 12 Dec 2019 07:29:29 +0000 (08:29 +0100)
Add extern C clauses to header files so that c++ builds do not break.

Signed-off-by: Felipe Huici <felipe.huici@neclab.eu>
Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
include/arpa/inet.h
include/netdb.h
include/sys/socket.h

index a1201a28bd0b938f3d00206ee06e68f71d9bc95b..c4d01d6ab729006b3e31803e3c8c3b980d9baa4c 100644 (file)
@@ -1,5 +1,12 @@
 #include <compat/posix/arpa/inet.h>
 
+#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
index 6944c59df51fb6bcc0197fbabbe4f474cbea7b37..7742012eb304b1a4c59f5846ea0fa422c0a127f9 100644 (file)
@@ -2,6 +2,10 @@
 #define _LWIP_GLUE_NETDB_H_
 #include <compat/posix/netdb.h>
 
+#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
 
index 3024e171a6edc3c0457603788d855611fab1360f..8007cb85897fe9718fcb087caf2c08946035c2b1 100644 (file)
 
 #ifndef _UK_LWIP_SOCKET_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <uk/config.h>
 #if CONFIG_HAVE_LIBC
 #include <fcntl.h>
@@ -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_ */