changeset 10539:affb655993ea

Make the headers usable in C++.
author Bruno Haible <bruno@clisp.org>
date Mon, 29 Sep 2008 11:37:15 +0200
parents 007b80185598
children bd583d46ccfb
files ChangeLog lib/sys_select.in.h lib/sys_socket.in.h
diffstat 3 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-29  Bruno Haible  <bruno@clisp.org>
+
+	* lib/sys_socket.in.h: Wrap the definitions in 'extern "C"'.
+	* lib/sys_select.in.h: Likewise.
+
 2008-09-29  Bruno Haible  <bruno@clisp.org>
 
 	* lib/winsock.c (rpl_close, rpl_socket): Remove unused variables.
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -40,10 +40,19 @@
 # include <sys/socket.h>
 
 # if @HAVE_WINSOCK2_H@
+
+#  ifdef __cplusplus
+extern "C" {
+#  endif
+
 #  undef select
 #  define select		rpl_select
+extern int rpl_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
 
-extern int rpl_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
+#  ifdef __cplusplus
+}
+#  endif
+
 # endif
 
 #endif
--- a/lib/sys_socket.in.h
+++ b/lib/sys_socket.in.h
@@ -105,6 +105,10 @@
 
 typedef int socklen_t;
 
+#  ifdef __cplusplus
+extern "C" {
+#  endif
+
 /* Re-define FD_ISSET to avoid a WSA call while we are not using 
    network sockets.  */
 static inline int
@@ -175,6 +179,10 @@
 extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int);
 extern int rpl_setsockopt (int, int, int, const void *, int);
 
+#  ifdef __cplusplus
+}
+#  endif
+
 # endif /* HAVE_WINSOCK2_H */
 
 #endif /* HAVE_SYS_SOCKET_H */