Make the headers usable in C++.
authorBruno Haible <bruno@clisp.org>
Mon, 29 Sep 2008 09:37:15 +0000 (11:37 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 29 Sep 2008 09:37:15 +0000 (11:37 +0200)
ChangeLog
lib/sys_select.in.h
lib/sys_socket.in.h

index 6a39236..bdff5cc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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.
 
 2008-09-29  Bruno Haible  <bruno@clisp.org>
index 341543b..255c02f 100644 (file)
 # 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 *);
+
+#  ifdef __cplusplus
+}
+#  endif
+
 # endif
 
 #endif
index c7cd57f..145408f 100644 (file)
 
 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_recvfrom (int, void *, int, int, struct sockaddr *, int *);
 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 */