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

[Minios-devel] [UNIKRAFT/LIBLWIP PATCH 3/3] 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..3c221c5 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 574a77d..9e6cbff 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)
@@ -74,4 +78,9 @@ int getnameinfo(const struct sockaddr *addr, socklen_t 
addrlen,
 
 struct servent *getservbyname(const char *name, const char *proto);
 struct servent *getservbyport(int port, const char *proto);
+
+#ifdef __cplusplus
+}
+#endif
+    
 #endif
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 03ed9eb..1b44cfb 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>
@@ -82,4 +86,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.11.0


_______________________________________________
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®.