[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/LIBLWIP PATCH v2 2/2] 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 <felipe.huici@xxxxxxxxx>
---
 include/arpa/inet.h  | 7 +++++++
 include/netdb.h      | 9 +++++++++
 include/sys/socket.h | 8 ++++++++
 3 files changed, 24 insertions(+)

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 <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
diff --git a/include/netdb.h b/include/netdb.h
index 5bbd354..6cca969 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -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)
@@ -81,5 +85,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 f23ad32..090183a 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 <uk/config.h>
 #if CONFIG_HAVE_LIBC
 #include <fcntl.h>
@@ -89,4 +93,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_ */
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.