Remove old, dead code in last commit.
[gnulib.git] / lib / sys_socket.in.h
index ddc4264..63c80ff 100644 (file)
@@ -27,7 +27,9 @@
 
 #if @HAVE_SYS_SOCKET_H@
 
+# if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+# endif
 
 /* On many platforms, <sys/socket.h> assumes prior inclusion of
    <sys/types.h>.  */
@@ -118,9 +120,9 @@ extern "C" {
 /* Re-define FD_ISSET to avoid a WSA call while we are not using
    network sockets.  */
 static inline int
-rpl_fd_isset (int fd, fd_set * set)
+rpl_fd_isset (SOCKET fd, fd_set * set)
 {
-  int i;
+  u_int i;
   if (set == NULL)
     return 0;
 
@@ -143,6 +145,11 @@ rpl_fd_isset (int fd, fd_set * set)
 #  define close close_used_without_including_unistd_h
 # endif
 
+# if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H
+#  undef gethostname
+#  define gethostname gethostname_used_without_including_unistd_h
+# endif
+
 # if @GNULIB_SOCKET@
 #  if @HAVE_WINSOCK2_H@
 #   undef socket
@@ -279,12 +286,6 @@ extern int rpl_listen (int, int);
       listen (s, b))
 # endif
 
-# if @HAVE_WINSOCK2_H@
-#  undef ioctl
-#  define ioctl                        rpl_ioctl
-extern int rpl_ioctl (int, int, ...);
-# endif
-
 # if @GNULIB_RECV@
 #  if @HAVE_WINSOCK2_H@
 #   undef recv
@@ -370,17 +371,28 @@ extern int rpl_setsockopt (int, int, int, const void *, int);
       setsockopt (s, lvl, o, v, l))
 # endif
 
+# if @GNULIB_SHUTDOWN@
+#  if @HAVE_WINSOCK2_H@
+#   undef shutdown
+#   define shutdown            rpl_shutdown
+extern int rpl_shutdown (int, int);
+#  endif
+# elif @HAVE_WINSOCK2_H@
+#  undef shutdown
+#  define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
+# elif defined GNULIB_POSIXCHECK
+#  undef shutdown
+#  define shutdown(s,h) \
+     (GL_LINK_WARNING ("shutdown is not always POSIX compliant - " \
+                       "use gnulib module shutdown for portability"), \
+      shutdown (s, h))
+# endif
+
 # if @HAVE_WINSOCK2_H@
 #  undef select
 #  define select               select_used_without_including_sys_select_h
 # endif
 
-# if @GNULIB_CLOSE@ && @HAVE_WINSOCK2_H@
-/* gnulib internal function.  */
-#  define HAVE__GL_CLOSE_FD_MAYBE_SOCKET 1
-extern int _gl_close_fd_maybe_socket (int fd);
-# endif
-
 # ifdef __cplusplus
 }
 # endif