Cleanup and simplify winsock split changes.
authorBruno Haible <bruno@clisp.org>
Tue, 21 Oct 2008 15:15:43 +0000 (17:15 +0200)
committerSimon Josefsson <simon@josefsson.org>
Tue, 21 Oct 2008 15:15:43 +0000 (17:15 +0200)
Simplification.
* lib/sys_socket.in.h (_gl_close_fd_maybe_socket): Remove declaration.
* lib/close.c (_gl_close_fd_maybe_socket): Make static.

Simplification.
* lib/ioctl.c (ioctl): Don't undefine.
* lib/socket.c (socket): Don't undefine.

Remove unused module indicator macros.
* m4/sys_socket_h.m4 (gl_SYS_SOCKET_MODULE_INDICATOR): Don't define
GNULIB_$1 as a C macro.

* doc/posix-functions/close.texi: Undo last change.
* doc/posix-functions/ioctl.texi: Merge the two paragraphs about
Windows platforms.

ChangeLog
doc/posix-functions/close.texi
doc/posix-functions/ioctl.texi
lib/close.c
lib/ioctl.c
lib/socket.c
lib/sys_socket.in.h
m4/sys_socket_h.m4

index 1b7bbfa..132cb8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
 2008-10-21  Bruno Haible  <bruno@clisp.org>
 
+       Simplification.
+       * lib/sys_socket.in.h (_gl_close_fd_maybe_socket): Remove declaration.
+       * lib/close.c (_gl_close_fd_maybe_socket): Make static.
+
+       Simplification.
+       * lib/ioctl.c (ioctl): Don't undefine.
+       * lib/socket.c (socket): Don't undefine.
+
+       Remove unused module indicator macros.
+       * m4/sys_socket_h.m4 (gl_SYS_SOCKET_MODULE_INDICATOR): Don't define
+       GNULIB_$1 as a C macro.
+
+       * doc/posix-functions/close.texi: Undo last change.
+       * doc/posix-functions/ioctl.texi: Merge the two paragraphs about
+       Windows platforms.
+
+2008-10-21  Bruno Haible  <bruno@clisp.org>
+
        Add gethostname() declaration to <unistd.h>.
        * lib/unistd.in.h (gethostname): New declaration.
        * lib/gethostname.c: Include <unistd.h>.
index 7065efa..252caea 100644 (file)
@@ -12,10 +12,6 @@ Portability problems fixed by Gnulib:
 On Windows platforms (excluding Cygwin), @code{socket} and @code{accept}
 do not return file descriptors that can be closed by @code{close}.
 Instead, @code{closesocket} must be used.
-@item
-On Windows platforms (excluding Cygwin), error codes for @code{close}
-are not placed in @code{errno}, and @code{WSAGetLastError} must be
-used instead.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 85ba764..d1574bb 100644 (file)
@@ -9,11 +9,9 @@ Gnulib module: ioctl
 Portability problems fixed by Gnulib:
 @itemize
 @item
-On Windows platforms (excluding Cygwin), error codes for @code{ioctl}
-are not placed in @code{errno}, and @code{WSAGetLastError} must be
-used instead.
-@item
-@code{ioctl} is called @code{ioctlsocket} under mingw
+On Windows platforms (excluding Cygwin), @code{ioctl} is called
+@code{ioctlsocket}, and error codes for this function are not placed in
+@code{errno}, and @code{WSAGetLastError} must be used instead.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 79313c0..74a7adf 100644 (file)
@@ -29,7 +29,7 @@
 /* Get set_winsock_errno, FD_TO_SOCKET etc. */
 #include "w32sock.h"
 
-int
+static int
 _gl_close_fd_maybe_socket (int fd)
 {
   SOCKET sock = FD_TO_SOCKET (fd);
index 98a94b6..a23d363 100644 (file)
@@ -28,8 +28,6 @@
 /* Get set_winsock_errno, FD_TO_SOCKET etc. */
 #include "w32sock.h"
 
-#undef ioctl
-
 int
 rpl_ioctl (int fd, int req, ...)
 {
index f14906a..1fa6928 100644 (file)
@@ -26,8 +26,6 @@
 /* Get set_winsock_errno, FD_TO_SOCKET etc. */
 #include "w32sock.h"
 
-#undef socket
-
 int
 rpl_socket (int domain, int type, int protocol)
 {
index b703200..fcb4a22 100644 (file)
@@ -389,9 +389,8 @@ extern int rpl_shutdown (int, int);
 # endif
 
 # if @GNULIB_CLOSE@ && @HAVE_WINSOCK2_H@
-/* gnulib internal function.  */
+/* Need a gnulib internal function.  */
 #  define HAVE__GL_CLOSE_FD_MAYBE_SOCKET 1
-extern int _gl_close_fd_maybe_socket (int fd);
 # endif
 
 # ifdef __cplusplus
index fc43d5c..b7b18e5 100644 (file)
@@ -96,7 +96,6 @@ AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
   GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
-  gl_MODULE_INDICATOR([$1])
 ])
 
 AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],