On 01/02/12 15:59, Bruno Haible wrote:
> Here's my counter-proposal (attached).

Thanks, that looks pretty good.  I see three files that
still need work, though:

 * lib/poll.c mentions "Win9x" and "WinXP".
 * lib/select.c is similar.
 * ChangeLog entries needed.

Also, the old-ChangeLog-entry work has been done and
I don't see an obstacle to putting it in.  That way
we don't have to worry about the "win"s creeping in
through the back door by people cloning old ChangeLog
entries.  It's not a big deal, of course.

So how about if we apply your patch, combined with
the following further patch?

diff --git a/lib/poll.c b/lib/poll.c
index 334bf60..d4d7150 100644
--- a/lib/poll.c
+++ b/lib/poll.c
@@ -161,11 +161,12 @@ windows_compute_revents (HANDLE h, int *p_sought)
         {
           /* It was the write-end of the pipe.  Check if it is writable.
              If NtQueryInformationFile fails, optimistically assume the pipe is
-             writable.  This could happen on Win9x, where 
NtQueryInformationFile
-             is not available, or if we inherit a pipe that doesn't permit
-             FILE_READ_ATTRIBUTES access on the write end (I think this should
-             not happen since WinXP SP2; WINE seems fine too).  Otherwise,
-             ensure that enough space is available for atomic writes.  */
+             writable.  This could happen on Windows 9x, where
+             NtQueryInformationFile is not available, or if we inherit a pipe
+             that doesn't permit FILE_READ_ATTRIBUTES access on the write end
+             (I think this should not happen since Windows XP SP2; WINE seems
+             fine too).  Otherwise, ensure that enough space is available for
+             atomic writes.  */
           memset (&iosb, 0, sizeof (iosb));
           memset (&fpli, 0, sizeof (fpli));
 
diff --git a/lib/select.c b/lib/select.c
index ef14dc3..57091a4 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -143,11 +143,12 @@ windows_poll_handle (HANDLE h, int fd,
         {
           /* It was the write-end of the pipe.  Check if it is writable.
              If NtQueryInformationFile fails, optimistically assume the pipe is
-             writable.  This could happen on Win9x, where 
NtQueryInformationFile
-             is not available, or if we inherit a pipe that doesn't permit
-             FILE_READ_ATTRIBUTES access on the write end (I think this should
-             not happen since WinXP SP2; WINE seems fine too).  Otherwise,
-             ensure that enough space is available for atomic writes.  */
+             writable.  This could happen on Windows 9x, where
+             NtQueryInformationFile is not available, or if we inherit a pipe
+             that doesn't permit FILE_READ_ATTRIBUTES access on the write end
+             (I think this should not happen since Windows XP SP2; WINE seems
+             fine too).  Otherwise, ensure that enough space is available for
+             atomic writes.  */
           memset (&iosb, 0, sizeof (iosb));
           memset (&fpli, 0, sizeof (fpli));
 
diff --git a/ChangeLog b/ChangeLog
index 2e2c71b..1b414f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2012-01-03  Paul Eggert  <egg...@cs.ucla.edu>
+           Bruno Haible  <br...@clisp.org>
+
+       Don't use the abbreviation "win" to refer to Windows.
+       This is suggested by the GNU coding standards.
+       It came up when fixing a similar problem in GNU Emacs
+       <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10421>.
+       All uses of the renamed identifiers changed.
+       * lib/poll.c (windows_compute_revents): Rename from
+       win32_compute_revents.
+       (windows_compute_revents_socket): Rename from
+       win32_compute_revents_socket.
+       * lib/select.c (windows_poll_handle): Rename from win32_poll_handle.
+       * m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Add support for
+       --enable-threads=windows as a preferred alias for the (now deprecated)
+       --enable-threads=win32.
+       (gl_THREADLIB_BODY): Define USE_WINDOWS_THREADS, not USE_WIN32_THREADS.
+       * lib/getaddrinfo.c, lib/localcharset.c, lib/localname.c, lib/poll.c:
+       * lib/progreloc.c, tests/test-poll.c, tests/test-select.h:
+       (WINDOWS_NATIVE): Rename from WIN32_NATIVE.
+
 2012-01-02  Bruno Haible  <br...@clisp.org>
 
        canonicalize: Tweak 2011-12-29 commit.
@@ -1756,7 +1777,7 @@
        EDESTADDRREQ, EMSGSIZE, EPROTOTYPE, ENOPROTOOPT, EPROTONOSUPPORT,
        EOPNOTSUPP, EAFNOSUPPORT, EADDRINUSE, EADDRNOTAVAIL, ENETDOWN,
        ENETUNREACH, ECONNRESET, ENOBUFS, EISCONN, ENOTCONN, ETIMEDOUT,
-       ECONNREFUSED, ELOOP, EHOSTUNREACH, EWOULDBLOCK, ETXTBSY) [Win32]:
+       ECONNREFUSED, ELOOP, EHOSTUNREACH, EWOULDBLOCK, ETXTBSY) [_WIN32]:
        Assign values compatible with MSVC 10.
        (ENODATA, ENOSR, ENOSTR, ENOTRECOVERABLE, EOWNERDEAD, ETIME, EOTHER):
        New macros.
@@ -3797,12 +3818,12 @@
 
 2011-09-21  Bruno Haible  <br...@clisp.org>
 
-       ftruncate: Un-deprecate, concentrate on Win32 support.
+       ftruncate: Un-deprecate, concentrate on Windows support.
        * modules/ftruncate (Status, Notice): Remove sections.
        (Depends-on): Add largefile.
        * m4/ftruncate.m4 (gl_FUNC_FTRUNCATE): Drop failure message on
        non-mingw platforms.
-       * lib/ftruncate.c: Remove code for the older platforms. For Win32,
+       * lib/ftruncate.c: Remove code for the older platforms. For Windows,
        include <io.h>.
        * modules/perror-tests (Depends-on): Add ftruncate.
        * doc/posix-functions/ftruncate.texi: Mention the MSVC problem and the
@@ -10373,8 +10394,8 @@
        pipe2: Remove dependency on 'nonblocking' module.
        * lib/pipe2.c: Include verify.h. Include nonblocking.h only if
        O_NONBLOCK is defined by gnulib.
-       (pipe2) [WIN32]: If O_NONBLOCK is not defined by gnulib, verify that it
-       is zero.
+       (pipe2) [_WIN32]: If O_NONBLOCK is not defined by gnulib, verify that
+       it is zero.
        * modules/pipe2 (Depends-on): Add verify. Remove nonblocking.
        * tests/test-pipe2.c: Include nonblocking.h only if O_NONBLOCK is
        defined by gnulib.
@@ -10913,7 +10934,7 @@
 
        select: Simplify replacement idiom.
        * m4/select.m4 (gl_FUNC_SELECT): Set REPLACE_SELECT also on native
-       Win32 platforms.
+       Windows platforms.
        * lib/sys_select.in.h (select): Simplify accordingly.
        * modules/select (Depends-on): Likewise.
 
@@ -11078,7 +11099,7 @@
        * lib/strerror.c: Define _NETBSD_SOURCE. Include <nl_types.h>.
        (sys_nerr, sys_errlist): New declarations.
        (strerror_r): Be careful not to clobber the strerror buffer on NetBSD,
-       HP-UX, native Win32, IRIX, and 32-bit Solaris.
+       HP-UX, native Windows, IRIX, and 32-bit Solaris.
        * m4/strerror_r.m4 (gl_PREREQ_STRERROR_R): Test whether catgets exists.
 
 2011-05-19  Bruno Haible  <br...@clisp.org>
@@ -12907,11 +12928,11 @@
        * modules/nonblocking-tests (Depends-on): Drop socket.
        (Makefile.am): Link even if sockets are not present.
        * modules/pipe2-tests (Makefile.am): Likewise.
-       * lib/ioctl.c (ioctl) [WIN32]: Fail if sockets are not also in use.
+       * lib/ioctl.c (ioctl) [_WIN32]: Fail if sockets are not also in use.
 
        pipe2: fix O_NONBLOCK support on mingw
        * modules/pipe2 (Depends-on): Add nonblocking.
-       * lib/pipe2.c (pipe2) [WIN32]: Add O_NONBLOCK support.
+       * lib/pipe2.c (pipe2) [_WIN32]: Add O_NONBLOCK support.
        * tests/test-pipe2.c (is_nonblocking): Adjust test accordingly.
        * tests/test-nonblocking.c (main): Likewise.
        * modules/pipe2-tests (Makefile.am): Avoid link failure.
@@ -14064,15 +14085,15 @@
            Charles Wilson  <cyg...@cwilson.fastmail.fm>  (tiny change)
            Bruno Haible  <br...@clisp.org>  (tiny change)
 
-       On Cygwin, use /proc file system instead of win32 API.
+       On Cygwin, use /proc file system instead of the Windows API.
        * lib/relocatable.c: On Cygwin, use file names from /proc, rather than
-       Win32 file names.
+       Windows file names.
        (DllMain): Simplify by removing Cygwin specific code.
        (find_shared_library_fullname): Use Linux specific implementation also
        for Cygwin.
        (get_shared_library_fullname): Update accordingly.
        * lib/progreloc.c: On Cygwin, use file names from /proc, rather than
-       Win32 file names.
+       Windows file names.
        (find_executable): On Cygwin, use /proc, like on Linux. Remove previous
        Cygwin specific code.
 
@@ -15592,7 +15613,7 @@
 
        dup2: work around Haiku bug
        * m4/dup2.m4 (gl_FUNC_DUP2): Test for bug.
-       * lib/dup2.c (rpl_dup2) [!WIN32]: Add workaround.
+       * lib/dup2.c (rpl_dup2) [!_WIN32]: Add workaround.
        * doc/posix-functions/dup2.texi (dup2): Document the bug.
        * tests/test-dup2.c (main): Enhance test.
 
@@ -31880,7 +31901,7 @@
 
 2009-12-21  Bruno Haible  <br...@clisp.org>
 
-       Update list of Win32 locale ids.
+       Update list of Windows locale ids.
        * lib/localename.c (LANG_ROMANSH): Renamed from LANG_RHAETO_ROMANCE.
        (LANG_SAMI): Renamed from LANG_SAAMI.
        (LANG_BASHKIR, LANG_LUXEMBOURGISH, LANG_GREENLANDIC,
@@ -32891,7 +32912,7 @@
        * lib/unistd--.h (pipe2): New wrapper.
        * lib/pipe-safer.c (pipe2_safer): New function.
        * modules/pipe (Depends-on): Add pipe2-safer.
-       * lib/pipe.c (create_pipe) [WIN32]: Let pipe2_safer do the work.
+       * lib/pipe.c (create_pipe) [_WIN32]: Let pipe2_safer do the work.
 
        stdlib-safer: preserve cloexec flag for mkostemp[s]
        * lib/mkstemp-safer.c (mkostemp_safer, mkostemps_safer): Use new
@@ -33048,7 +33069,7 @@
 
 2009-11-26  Richard Jones  <rjo...@redhat.com>
 
-       w32sock: leave win32 error in place.
+       w32sock: leave Windows error in place.
        * lib/w32sock.h (set_winsock_errno): Do not call WSASetLastError.
 
 2009-11-26  Eric Blake  <e...@byu.net>
@@ -37303,7 +37324,7 @@
 
        Fix polling for writeability of a screen buffer.
        * lib/poll.c: Distinguish input and screen buffers for the
-       Win32 implementation.
+       Windows implementation.
        * lib/select.c: Likewise.
 
 2009-08-19  Eric Blake  <e...@byu.net>
@@ -38229,7 +38250,7 @@
 2009-07-19  Bruno Haible  <br...@clisp.org>
 
        Unify conditionals.
-       * lib/pipe.h: Detect native Win32 by looking at _WIN32 and __WIN32__
+       * lib/pipe.h: Detect native Windows by looking at _WIN32 and __WIN32__
        macros, not at the compiler macros.
        * lib/pipe.c: Likewise.
        * lib/execute.c: Likewise.
@@ -38244,13 +38265,13 @@
        (fd_safer_noinherit): New function, based on fd-safer.c.
        (dup_safer_noinherit): New function, based on dup-safer.c.
        (undup_safer_noinherit): New function.
-       * lib/execute.c (execute) [WIN32]: Use dup_safer_noinherit instead of
+       * lib/execute.c (execute) [_WIN32]: Use dup_safer_noinherit instead of
        dup_noinherit. Use undup_safer_noinherit instead of dup2 and close.
-       * lib/pipe.c (create_pipe) [WIN32]: Likewise. Use fd_safer_noinherit
+       * lib/pipe.c (create_pipe) [_WIN32]: Likewise. Use fd_safer_noinherit
        instead of fd_safer.
        * tests/test-pipe.c: Include <windows.h>.
-       (child_main) [WIN32]: Test the handle of STDERR_FILENO, not its close()
-       result.
+       (child_main) [_WIN32]: Test the handle of STDERR_FILENO,
+       not its close() result.
 
        * tests/test-pipe.c (child_main, parent_main): New functions, extracted
        from main.
@@ -46062,7 +46083,7 @@
 
 2008-10-17  Bruno Haible  <br...@clisp.org>
 
-       New implementation of condition variables for Win32.
+       New implementation of condition variables for Windows.
        * lib/glthread/cond.h (struct gl_waitqueue_link): New type.
        (gl_linked_waitqueue_t): New type.
        (gl_cond_t): Use it.
@@ -46165,7 +46186,7 @@
 
 2008-10-12  Bruno Haible  <br...@clisp.org>
 
-       Use msvcrt aware primitives for creation/termination of Win32 threads.
+       Use msvcrt aware primitives for creation/termination of Windows threads.
        * lib/glthread/thread.c: Include <process.h>.
        (glthread_create_func): Use _beginthreadex instead of CreateThread.
        (wrapper_func): Update signature.
@@ -46174,7 +46195,7 @@
 2008-10-11  Yoann Vandoorselaere  <yo...@prelude-ids.org>
            Bruno Haible  <br...@clisp.org>
 
-       Provide a Win32 implementation of the 'cond' module.
+       Provide a Windows implementation of the 'cond' module.
        * lib/glthread/cond.h [USE_WIN32]: New implementation.
        * lib/glthread/cond.c (glthread_cond_init_func,
        glthread_cond_wait_func, glthread_cond_timedwait_func,
@@ -46681,7 +46702,7 @@
 2008-10-03  Paolo Bonzini  <bonz...@gnu.org>
            Bruno Haible  <br...@clisp.org>
 
-       * lib/errno.in.h (EWOULDBLOCK) [win32]: Define to EAGAIN.
+       * lib/errno.in.h (EWOULDBLOCK) [_WIN32]: Define to EAGAIN.
        * lib/winsock.c (set_winsock_errno): Map WSAEWOULDBLOCK to EWOULDBLOCK.
        * lib/strerror.c (rpl_strerror): Remove error string for EWOULDBLOCK.
 
@@ -46824,7 +46845,7 @@
 
 2008-09-30  Bruno Haible  <br...@clisp.org>
 
-       Fix the Win32 implementation of the 'thread' module.
+       Fix the Windows implementation of the 'thread' module.
        * lib/glthread/thread.h [USE_WIN32_THREADS] (gl_thread_t): Change to a
        pointer type.
        (gl_thread_self): Invoke gl_thread_self_func.
@@ -47832,7 +47853,7 @@
 
 2008-09-11  Yoann Vandoorselaere  <yoan...@prelude-ids.com>
 
-       * lib/poll.c (poll): Fix polling unconnected server sockets on WIN32.
+       * lib/poll.c (poll): Fix polling unconnected server sockets on Windows.
 
 2008-09-11  Jim Meyering  <meyer...@redhat.com>
 
@@ -48332,7 +48353,7 @@
 2008-08-17  Bruno Haible  <br...@clisp.org>
 
        * lib/glthread/thread.c: New file, based on code from tests/test-lock.c.
-       * lib/glthread/thread.h: Provide Win32 specific implementation.
+       * lib/glthread/thread.h: Provide Windows specific implementation.
        * modules/thread (Files): Add lib/glthread/thread.c.
        (Depends-on): Add lock.
        (Makefile.am): Add glthread/thread.c to lib_SOURCES.
@@ -50518,7 +50539,7 @@
 2008-04-28  Simon Josefsson  <si...@josefsson.org>
 
        * m4/sys_socket_h.m4: Require AC_C_INLINE when necessary.
-       * lib/sys_socket.in.h (setsockopt): Use proper win32 tests (don't
+       * lib/sys_socket.in.h (setsockopt): Use proper Windows tests (don't
        trigger for cygwin).
        Reported by Bruno Haible  <br...@clisp.org>.
 
@@ -60091,7 +60112,7 @@
 
 2007-05-18  Bruno Haible  <br...@clisp.org>
 
-       * lib/vasnprintf.c (VASNPRINTF) [WIN32]: Use %I64d instead of %lld
+       * lib/vasnprintf.c (VASNPRINTF) [_WIN32]: Use %I64d instead of %lld
        for printing 64-bit integers. Needed for mingw.
 
 2007-05-18  Bruno Haible  <br...@clisp.org>
@@ -63712,7 +63733,7 @@
 
 2007-02-15  Bruno Haible  <br...@clisp.org>
 
-       * lib/clean-temp.c [WIN32 && !CYGWIN]: Include <windows.h>.
+       * lib/clean-temp.c [_WIN32 && !CYGWIN]: Include <windows.h>.
        (supports_delete_on_close): New function.
        (open_temp, fopen_temp): Use _O_TEMPORARY when supported.
 
@@ -65016,7 +65037,7 @@
 
 2007-01-22  Yoann Vandoorselaere  <yoan...@prelude-ids.com>
 
-       * lib/poll.c (rpl_poll): Don't check against FD_SETSIZE under Win32.
+       * lib/poll.c (rpl_poll): Don't check against FD_SETSIZE under Windows.
 
 2007-01-21  Bruno Haible  <br...@clisp.org>
 
@@ -71039,7 +71060,7 @@
 
                * localcharset.c [CYGWIN]: Include <windows.h>.
                (get_charset_aliases): For Cygwin, return the same CPxxx
-               aliases list as under WIN32.
+               aliases list as under Windows.
                (locale_charset) [CYGWIN]: Try to retrieve the encoding from
                the environment variables. Fall back to GetACP().
 
@@ -76158,7 +76179,7 @@
 
 2005-08-25  Simon Josefsson  <j...@extundo.com>
 
-       * lib/getpass.c: Add WIN32 implementation.  Conditionalize use of
+       * lib/getpass.c: Add Windows implementation.  Conditionalize use of
        termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
        GLIBC specific code.
 
@@ -88077,7 +88098,7 @@
 
 2000-12-19  Bruno Haible  <hai...@clisp.cons.org>
 
-       * lib/localcharset.c (locale_charset): Add support for Win32.
+       * lib/localcharset.c (locale_charset): Add support for Windows.
 
 2000-12-18  Paul Eggert  <egg...@twinsun.com>
 

Reply via email to