summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog159
-rw-r--r--lib/accept4.c2
-rw-r--r--lib/canonicalize-lgpl.c2
-rw-r--r--lib/classpath.c2
-rw-r--r--lib/clean-temp.c8
-rw-r--r--lib/csharpexec.c2
-rw-r--r--lib/ctime.c2
-rw-r--r--lib/dosname.h5
-rw-r--r--lib/dup2.c2
-rw-r--r--lib/errno.in.h4
-rw-r--r--lib/error.c4
-rw-r--r--lib/euidaccess.c4
-rw-r--r--lib/execute.c6
-rw-r--r--lib/fcntl.c4
-rw-r--r--lib/fcntl.in.h2
-rw-r--r--lib/filename.h2
-rw-r--r--lib/findprog.c2
-rw-r--r--lib/flock.c2
-rw-r--r--lib/fopen.c2
-rw-r--r--lib/freopen.c2
-rw-r--r--lib/fstat.c2
-rw-r--r--lib/fsync.c2
-rw-r--r--lib/gc-gnulib.c8
-rw-r--r--lib/get-rusage-data.c2
-rw-r--r--lib/getaddrinfo.c2
-rw-r--r--lib/getdelim.c2
-rw-r--r--lib/getdtablesize.c2
-rw-r--r--lib/gethostname.c2
-rw-r--r--lib/getlogin.c4
-rw-r--r--lib/getlogin_r.c4
-rw-r--r--lib/getopt.c2
-rw-r--r--lib/getpagesize.c2
-rw-r--r--lib/getpass.c2
-rw-r--r--lib/getrusage.c4
-rw-r--r--lib/gettimeofday.c2
-rw-r--r--lib/glob.c2
-rw-r--r--lib/inttypes.in.h2
-rw-r--r--lib/isapipe.c2
-rw-r--r--lib/javaexec.c2
-rw-r--r--lib/link.c2
-rw-r--r--lib/localcharset.c4
-rw-r--r--lib/localename.c2
-rw-r--r--lib/localename.h2
-rw-r--r--lib/localtime.c2
-rw-r--r--lib/lseek.c4
-rw-r--r--lib/mbsinit.c2
-rw-r--r--lib/mkdir.c2
-rw-r--r--lib/msvc-nothrow.h2
-rw-r--r--lib/nanosleep.c2
-rw-r--r--lib/nl_langinfo.c4
-rw-r--r--lib/nonblocking.c2
-rw-r--r--lib/nproc.c6
-rw-r--r--lib/open.c2
-rw-r--r--lib/openpty.c2
-rw-r--r--lib/pathmax.h2
-rw-r--r--lib/pipe-filter-aux.c2
-rw-r--r--lib/pipe-filter-gi.c8
-rw-r--r--lib/pipe-filter-ii.c14
-rw-r--r--lib/pipe.c2
-rw-r--r--lib/pipe2.c7
-rw-r--r--lib/poll.c2
-rw-r--r--lib/popen.c2
-rw-r--r--lib/posix_openpt.c2
-rw-r--r--lib/printf-parse.c2
-rw-r--r--lib/progreloc.c4
-rw-r--r--lib/putenv.c4
-rw-r--r--lib/read.c2
-rw-r--r--lib/relocatable.c13
-rw-r--r--lib/rename.c2
-rw-r--r--lib/same-inode.h2
-rw-r--r--lib/secure_getenv.c2
-rw-r--r--lib/select.c2
-rw-r--r--lib/sethostname.c2
-rw-r--r--lib/setlocale.c8
-rw-r--r--lib/sigaction.c2
-rw-r--r--lib/sigprocmask.c2
-rw-r--r--lib/sleep.c2
-rw-r--r--lib/spawn-pipe.c8
-rw-r--r--lib/spawn-pipe.h2
-rw-r--r--lib/spawni.c2
-rw-r--r--lib/stat-time.h2
-rw-r--r--lib/stat-w32.c2
-rw-r--r--lib/stat.c2
-rw-r--r--lib/stdio-impl.h2
-rw-r--r--lib/stdio-read.c2
-rw-r--r--lib/stdio-write.c2
-rw-r--r--lib/stdio.in.h4
-rw-r--r--lib/stdlib.in.h4
-rw-r--r--lib/strerror_r.c6
-rw-r--r--lib/strftime-fixes.c2
-rw-r--r--lib/sys_stat.in.h6
-rw-r--r--lib/sys_types.in.h3
-rw-r--r--lib/sys_wait.in.h6
-rw-r--r--lib/system-quote.c14
-rw-r--r--lib/system-quote.h2
-rw-r--r--lib/tmpdir.c6
-rw-r--r--lib/tzset.c2
-rw-r--r--lib/uname.c2
-rw-r--r--lib/unistd.in.h6
-rw-r--r--lib/utime.c2
-rw-r--r--lib/utime.in.h2
-rw-r--r--lib/utimecmp.c2
-rw-r--r--lib/utimens.c3
-rw-r--r--lib/vasnprintf.c14
-rw-r--r--lib/vma-iter.c4
-rw-r--r--lib/vma-iter.h2
-rw-r--r--lib/wait-process.c2
-rw-r--r--lib/wcsftime.c2
-rw-r--r--lib/wctype.in.h2
-rw-r--r--lib/write.c2
-rw-r--r--m4/csharpexec.m44
-rw-r--r--m4/getcwd.m44
-rw-r--r--m4/javacomp.m44
-rw-r--r--m4/javaexec.m44
-rw-r--r--m4/locale-ar.m44
-rw-r--r--m4/locale-fr.m46
-rw-r--r--m4/locale-ja.m44
-rw-r--r--m4/locale-tr.m44
-rw-r--r--m4/locale-zh.m44
-rw-r--r--m4/malloc.m44
-rw-r--r--m4/nocrash.m44
-rw-r--r--m4/pathmax.m44
-rw-r--r--m4/ptsname_r.m44
-rw-r--r--m4/stdio_h.m44
-rw-r--r--m4/tmpfile.m44
-rw-r--r--m4/unistd_h.m44
-rw-r--r--tests/nap.h2
-rw-r--r--tests/test-cloexec.c6
-rw-r--r--tests/test-dup-safer.c6
-rw-r--r--tests/test-dup2.c6
-rw-r--r--tests/test-dup3.c6
-rw-r--r--tests/test-fcntl.c6
-rw-r--r--tests/test-get-rusage-data.c2
-rw-r--r--tests/test-getaddrinfo.c2
-rw-r--r--tests/test-getlogin.h6
-rw-r--r--tests/test-isatty.c2
-rw-r--r--tests/test-localename.c6
-rw-r--r--tests/test-mbrtowc-w32.c2
-rw-r--r--tests/test-nonblocking-pipe-main.c4
-rw-r--r--tests/test-nonblocking-socket-main.c4
-rw-r--r--tests/test-nonblocking-socket.h2
-rw-r--r--tests/test-nonblocking.c2
-rw-r--r--tests/test-pipe.c8
-rw-r--r--tests/test-pipe2.c8
-rw-r--r--tests/test-poll.c2
-rw-r--r--tests/test-pthread_sigmask1.c2
-rw-r--r--tests/test-select.h2
-rw-r--r--tests/test-sethostname2.c2
-rw-r--r--tests/test-sigprocmask.c2
-rw-r--r--tests/test-spawn-pipe-child.c4
-rw-r--r--tests/test-stat-time.c2
-rw-r--r--tests/test-system-quote-main.c2
-rw-r--r--tests/test-utimens-common.h2
-rw-r--r--tests/test-wcrtomb-w32.c2
154 files changed, 419 insertions, 271 deletions
diff --git a/ChangeLog b/ChangeLog
index 990fb24991..712f62b53c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,162 @@
+2018-05-03 Bruno Haible <bruno@clisp.org>
+
+ Simplify code. Drop support for Borland C++ on Windows.
+ Reported by Gisle Vanem <gisle.vanem@gmail.com>.
+ * lib/accept4.c: Simplify 'defined _WIN32 || defined __WIN32__' to just
+ 'defined _WIN32'.
+ * lib/canonicalize-lgpl.c: Likewise.
+ * lib/classpath.c: Likewise.
+ * lib/clean-temp.c: Likewise.
+ * lib/csharpexec.c: Likewise.
+ * lib/ctime.c: Likewise.
+ * lib/dosname.h: Likewise.
+ * lib/dup2.c: Likewise.
+ * lib/errno.in.h: Likewise.
+ * lib/error.c: Likewise.
+ * lib/euidaccess.c: Likewise.
+ * lib/execute.c: Likewise.
+ * lib/fcntl.in.h: Likewise.
+ * lib/fcntl.c: Likewise.
+ * lib/filename.h: Likewise.
+ * lib/findprog.c: Likewise.
+ * lib/flock.c: Likewise.
+ * lib/fopen.c: Likewise.
+ * lib/freopen.c: Likewise.
+ * lib/fstat.c: Likewise.
+ * lib/fsync.c: Likewise.
+ * lib/gc-gnulib.c: Likewise.
+ * lib/get-rusage-data.c: Likewise.
+ * lib/getaddrinfo.c: Likewise.
+ * lib/getdelim.c: Likewise.
+ * lib/getdtablesize.c: Likewise.
+ * lib/gethostname.c: Likewise.
+ * lib/getlogin.c: Likewise.
+ * lib/getlogin_r.c: Likewise.
+ * lib/getopt.c: Likewise.
+ * lib/getpagesize.c: Likewise.
+ * lib/getpass.c: Likewise.
+ * lib/getrusage.c: Likewise.
+ * lib/gettimeofday.c: Likewise.
+ * lib/glob.c: Likewise.
+ * lib/inttypes.in.h: Likewise.
+ * lib/isapipe.c: Likewise.
+ * lib/javaexec.c: Likewise.
+ * lib/link.c: Likewise.
+ * lib/localcharset.c: Likewise.
+ * lib/localename.h: Likewise.
+ * lib/localename.c: Likewise.
+ * lib/localtime.c: Likewise.
+ * lib/lseek.c: Likewise.
+ * lib/mbsinit.c: Likewise.
+ * lib/mkdir.c: Likewise.
+ * lib/msvc-nothrow.h: Likewise.
+ * lib/nanosleep.c: Likewise.
+ * lib/nl_langinfo.c: Likewise.
+ * lib/nonblocking.c: Likewise.
+ * lib/nproc.c: Likewise.
+ * lib/open.c: Likewise.
+ * lib/openpty.c: Likewise.
+ * lib/pathmax.h: Likewise.
+ * lib/pipe-filter-aux.c: Likewise.
+ * lib/pipe-filter-gi.c: Likewise.
+ * lib/pipe-filter-ii.c: Likewise.
+ * lib/pipe.c: Likewise.
+ * lib/pipe2.c: Likewise.
+ * lib/poll.c: Likewise.
+ * lib/popen.c: Likewise.
+ * lib/posix_openpt.c: Likewise.
+ * lib/printf-parse.c: Likewise.
+ * lib/progreloc.c: Likewise.
+ * lib/putenv.c: Likewise.
+ * lib/read.c: Likewise.
+ * lib/relocatable.c: Likewise.
+ * lib/rename.c: Likewise.
+ * lib/same-inode.h: Likewise.
+ * lib/secure_getenv.c: Likewise.
+ * lib/select.c: Likewise.
+ * lib/sethostname.c: Likewise.
+ * lib/setlocale.c: Likewise.
+ * lib/sigaction.c: Likewise.
+ * lib/sigprocmask.c: Likewise.
+ * lib/sleep.c: Likewise.
+ * lib/spawn-pipe.h: Likewise.
+ * lib/spawn-pipe.c: Likewise.
+ * lib/spawni.c: Likewise.
+ * lib/stat-time.h: Likewise.
+ * lib/stat-w32.c: Likewise.
+ * lib/stat.c: Likewise.
+ * lib/stdio.in.h: Likewise.
+ * lib/stdio-impl.h: Likewise.
+ * lib/stdio-read.c: Likewise.
+ * lib/stdio-write.c: Likewise.
+ * lib/stdlib.in.h: Likewise.
+ * lib/strerror_r.c: Likewise.
+ * lib/strftime-fixes.c: Likewise.
+ * lib/sys_stat.in.h: Likewise.
+ * lib/sys_types.in.h: Likewise.
+ * lib/sys_wait.in.h : Likewise.
+ * lib/system-quote.h: Likewise.
+ * lib/system-quote.c: Likewise.
+ * lib/tmpdir.c: Likewise.
+ * lib/tzset.c: Likewise.
+ * lib/uname.c: Likewise.
+ * lib/unistd.in.h: Likewise.
+ * lib/utime.in.h: Likewise.
+ * lib/utime.c: Likewise.
+ * lib/utimecmp.c: Likewise.
+ * lib/utimens.c: Likewise.
+ * lib/vasnprintf.c: Likewise.
+ * lib/vma-iter.h: Likewise.
+ * lib/vma-iter.c: Likewise.
+ * lib/wait-process.c: Likewise.
+ * lib/wcsftime.c: Likewise.
+ * lib/wctype.in.h: Likewise.
+ * lib/write.c: Likewise.
+ * tests/nap.h: Likewise.
+ * tests/test-cloexec.c: Likewise.
+ * tests/test-dup-safer.c: Likewise.
+ * tests/test-dup2.c: Likewise.
+ * tests/test-dup3.c: Likewise.
+ * tests/test-fcntl.c: Likewise.
+ * tests/test-get-rusage-data.c: Likewise.
+ * tests/test-getaddrinfo.c: Likewise.
+ * tests/test-getlogin.h: Likewise.
+ * tests/test-isatty.c: Likewise.
+ * tests/test-localename.c: Likewise.
+ * tests/test-mbrtowc-w32.c: Likewise.
+ * tests/test-nonblocking.c: Likewise.
+ * tests/test-nonblocking-pipe-main.c: Likewise.
+ * tests/test-nonblocking-socket-main.c: Likewise.
+ * tests/test-nonblocking-socket.h: Likewise.
+ * tests/test-pipe.c: Likewise.
+ * tests/test-pipe2.c: Likewise.
+ * tests/test-poll.c: Likewise.
+ * tests/test-pthread_sigmask1.c: Likewise.
+ * tests/test-select.h: Likewise.
+ * tests/test-sethostname2.c: Likewise.
+ * tests/test-sigprocmask.c: Likewise.
+ * tests/test-spawn-pipe-child.c: Likewise.
+ * tests/test-stat-time.c: Likewise.
+ * tests/test-system-quote-main.c: Likewise.
+ * tests/test-utimens-common.h: Likewise.
+ * tests/test-wcrtomb-w32.c: Likewise.
+ * m4/csharpexec.m4 (gt_CSHARPEXEC): Likewise.
+ * m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Likewise.
+ * m4/javacomp.m4 (gt_JAVACOMP): Likewise.
+ * m4/javaexec.m4 (gt_JAVAEXEC): Likewise.
+ * m4/locale-ar.m4 (gt_LOCALE_AR): Likewise.
+ * m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Likewise.
+ * m4/locale-ja.m4 (gt_LOCALE_JA): Likewise.
+ * m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise.
+ * m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise.
+ * m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): Likewise.
+ * m4/nocrash.m4 (GL_NOCRASH): Likewise.
+ * m4/pathmax.m4 (gl_PATHMAX_SNIPPET): Likewise.
+ * m4/ptsname_r.m4 (gl_PREREQ_PTSNAME_R): Likewise.
+ * m4/stdio_h.m4 (gl_STDIO_H): Likewise.
+ * m4/tmpfile.m4 (gl_FUNC_TMPFILE): Likewise.
+ * m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
+
2018-05-02 Bruno Haible <bruno@clisp.org>
localename: Fix test failures on mingw.
diff --git a/lib/accept4.c b/lib/accept4.c
index 2283feed66..f615366691 100644
--- a/lib/accept4.c
+++ b/lib/accept4.c
@@ -69,7 +69,7 @@ accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags)
return -1;
#if SOCK_CLOEXEC
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
if (flags & SOCK_CLOEXEC)
{
diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c
index 898f0d109a..7831b3f19c 100644
--- a/lib/canonicalize-lgpl.c
+++ b/lib/canonicalize-lgpl.c
@@ -95,7 +95,7 @@
static void
alloc_failed (void)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Avoid errno problem without using the malloc or realloc modules; see:
https://lists.gnu.org/r/bug-gnulib/2016-08/msg00025.html */
errno = ENOMEM;
diff --git a/lib/classpath.c b/lib/classpath.c
index d1caa2d68e..2164b9a5ce 100644
--- a/lib/classpath.c
+++ b/lib/classpath.c
@@ -37,7 +37,7 @@
#endif
/* Separator in PATH like lists of pathnames. */
-#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
+#if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
/* Native Windows, OS/2, DOS */
# define PATH_SEPARATOR ';'
#else
diff --git a/lib/clean-temp.c b/lib/clean-temp.c
index e1f12ca815..dcc2602b7e 100644
--- a/lib/clean-temp.c
+++ b/lib/clean-temp.c
@@ -30,7 +30,7 @@
#include <string.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
#endif
@@ -563,7 +563,7 @@ cleanup_temp_dir (struct temp_dir *dir)
}
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On Windows, opening a file with _O_TEMPORARY has the effect of passing
the FILE_FLAG_DELETE_ON_CLOSE flag to CreateFile(), which has the effect
@@ -632,7 +632,7 @@ open_temp (const char *file_name, int flags, mode_t mode)
block_fatal_signals ();
/* Note: 'open' here is actually open() or open_safer(). */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Use _O_TEMPORARY when possible, to increase the chances that the
temporary file is removed when the process crashes. */
if (supports_delete_on_close ())
@@ -658,7 +658,7 @@ fopen_temp (const char *file_name, const char *mode)
block_fatal_signals ();
/* Note: 'fopen' here is actually fopen() or fopen_safer(). */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Use _O_TEMPORARY when possible, to increase the chances that the
temporary file is removed when the process crashes. */
if (supports_delete_on_close ())
diff --git a/lib/csharpexec.c b/lib/csharpexec.c
index 3f9d67a391..54b81d0182 100644
--- a/lib/csharpexec.c
+++ b/lib/csharpexec.c
@@ -43,7 +43,7 @@
#undef CLASSPATHVAR
/* Handling of clix' PATH variable is just like Java CLASSPATH. */
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
+#if defined _WIN32 || defined __CYGWIN__
/* Native Windows, Cygwin */
#define CLASSPATHVAR "PATH"
#elif defined __APPLE__ && defined __MACH__
diff --git a/lib/ctime.c b/lib/ctime.c
index ccc6879e67..6f409aa963 100644
--- a/lib/ctime.c
+++ b/lib/ctime.c
@@ -27,7 +27,7 @@
char *
rpl_ctime (const time_t *tp)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Rectify the value of the environment variable TZ.
There are four possible kinds of such values:
- Traditional US time zone names, e.g. "PST8PDT". Syntax: see
diff --git a/lib/dosname.h b/lib/dosname.h
index 66486d5209..fef3b6daa1 100644
--- a/lib/dosname.h
+++ b/lib/dosname.h
@@ -20,9 +20,8 @@
#ifndef _DOSNAME_H
#define _DOSNAME_H
-#if (defined _WIN32 || defined __WIN32__ || \
- defined __MSDOS__ || defined __CYGWIN__ || \
- defined __EMX__ || defined __DJGPP__)
+#if (defined _WIN32 || defined __CYGWIN__ \
+ || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__)
/* This internal macro assumes ASCII, but all hosts that support drive
letters use ASCII. */
# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \
diff --git a/lib/dup2.c b/lib/dup2.c
index c8b49b25e4..c7d176728d 100644
--- a/lib/dup2.c
+++ b/lib/dup2.c
@@ -29,7 +29,7 @@
# undef dup2
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
diff --git a/lib/errno.in.h b/lib/errno.in.h
index 04c326c323..b06d03d4fa 100644
--- a/lib/errno.in.h
+++ b/lib/errno.in.h
@@ -30,7 +30,7 @@
/* On native Windows platforms, many macros are not defined. */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* These are the same values as defined by MSVC 10, for interoperability. */
@@ -248,7 +248,7 @@
interoperability. */
# define EOWNERDEAD 58
# define ENOTRECOVERABLE 59
-# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# elif defined _WIN32 && ! defined __CYGWIN__
/* We have a conflict here: pthreads-win32 defines these values
differently than MSVC 10. It's hairy to decide which one to use. */
# if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
diff --git a/lib/error.c b/lib/error.c
index 81788c7b96..adc873391c 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -93,7 +93,7 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
# include <fcntl.h>
# include <unistd.h>
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -131,7 +131,7 @@ int strerror_r (int errnum, char *buf, size_t buflen);
static int
is_open (int fd)
{
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows: The initial state of unassigned standard file
descriptors is that they are open but point to an INVALID_HANDLE_VALUE.
There is no fcntl, and the gnulib replacement fcntl does not support
diff --git a/lib/euidaccess.c b/lib/euidaccess.c
index 4f512f5af5..de5d82b52d 100644
--- a/lib/euidaccess.c
+++ b/lib/euidaccess.c
@@ -29,7 +29,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <io.h>
#else
# include "root-uid.h"
@@ -87,7 +87,7 @@ euidaccess (const char *file, int mode)
return accessx (file, mode, ACC_SELF);
#elif HAVE_EACCESS /* FreeBSD */
return eaccess (file, mode);
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* mingw */
+#elif defined _WIN32 && ! defined __CYGWIN__ /* mingw */
return _access (file, mode);
#else /* Mac OS X, NetBSD, OpenBSD, HP-UX, Solaris, Cygwin, BeOS */
diff --git a/lib/execute.c b/lib/execute.c
index 065d83d65b..45326610d0 100644
--- a/lib/execute.c
+++ b/lib/execute.c
@@ -35,7 +35,7 @@
#define _(str) gettext (str)
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
# include <process.h>
@@ -49,7 +49,7 @@
#endif
-#if defined EINTR && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if defined EINTR && (defined _WIN32 && ! defined __CYGWIN__)
/* EINTR handling for close(), open().
These functions can return -1/EINTR even though we don't have any
@@ -99,7 +99,7 @@ execute (const char *progname,
bool slave_process, bool exit_on_error,
int *termsigp)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
int orig_stdin;
diff --git a/lib/fcntl.c b/lib/fcntl.c
index b8cb271f55..be6583565b 100644
--- a/lib/fcntl.c
+++ b/lib/fcntl.c
@@ -32,7 +32,7 @@
#endif
#undef fcntl
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -376,7 +376,7 @@ rpl_fcntl (int fd, int action, /* arg */...)
#if !HAVE_FCNTL
case F_GETFD:
{
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
HANDLE handle = (HANDLE) _get_osfhandle (fd);
DWORD flags;
if (handle == INVALID_HANDLE_VALUE
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index 719a54d0f7..a1e7d35c1b 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -68,7 +68,7 @@
/* Native Windows platforms declare open(), creat() in <io.h>. */
#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
- && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+ && (defined _WIN32 && ! defined __CYGWIN__)
# include <io.h>
#endif
diff --git a/lib/filename.h b/lib/filename.h
index a8127e8779..a7ad7e7e0c 100644
--- a/lib/filename.h
+++ b/lib/filename.h
@@ -28,7 +28,7 @@ extern "C" {
it may be concatenated to a directory pathname.
IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
*/
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
/* Native Windows, Cygwin, OS/2, DOS */
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
# define HAS_DEVICE(P) \
diff --git a/lib/findprog.c b/lib/findprog.c
index f4a009fd7b..7316418a9e 100644
--- a/lib/findprog.c
+++ b/lib/findprog.c
@@ -38,7 +38,7 @@
const char *
find_in_path (const char *progname)
{
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
/* Native Windows, Cygwin, OS/2, DOS */
/* The searching rules with .COM, .EXE, .BAT, .CMD etc. suffixes are
too complicated. Leave it to the OS. */
diff --git a/lib/flock.c b/lib/flock.c
index 86c91a97cf..8ccb1cdfb1 100644
--- a/lib/flock.c
+++ b/lib/flock.c
@@ -24,7 +24,7 @@
#include <config.h>
#include <sys/file.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* LockFileEx */
# define WIN32_LEAN_AND_MEAN
diff --git a/lib/fopen.c b/lib/fopen.c
index 409f54f211..2c9a75d0b0 100644
--- a/lib/fopen.c
+++ b/lib/fopen.c
@@ -47,7 +47,7 @@ orig_fopen (const char *filename, const char *mode)
FILE *
rpl_fopen (const char *filename, const char *mode)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
if (strcmp (filename, "/dev/null") == 0)
filename = "NUL";
#endif
diff --git a/lib/freopen.c b/lib/freopen.c
index 0d7de225d2..4111c24af8 100644
--- a/lib/freopen.c
+++ b/lib/freopen.c
@@ -47,7 +47,7 @@ FILE *
rpl_freopen (const char *filename, const char *mode, FILE *stream)
{
FILE *result;
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
char const *null_device = "NUL";
if (filename && strcmp (filename, "/dev/null") == 0)
filename = null_device;
diff --git a/lib/fstat.c b/lib/fstat.c
index c143d46134..41ee7618d2 100644
--- a/lib/fstat.c
+++ b/lib/fstat.c
@@ -25,7 +25,7 @@
#include <sys/stat.h>
#undef __need_system_sys_stat_h
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WINDOWS_NATIVE
#endif
diff --git a/lib/fsync.c b/lib/fsync.c
index 4937ab7687..efe43e166c 100644
--- a/lib/fsync.c
+++ b/lib/fsync.c
@@ -25,7 +25,7 @@
#include <config.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* FlushFileBuffers */
# define WIN32_LEAN_AND_MEAN
diff --git a/lib/gc-gnulib.c b/lib/gc-gnulib.c
index f7c96646f5..23301539f1 100644
--- a/lib/gc-gnulib.c
+++ b/lib/gc-gnulib.c
@@ -70,7 +70,7 @@
#endif
#ifdef GNULIB_GC_RANDOM
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
# include <windows.h>
# include <wincrypt.h>
HCRYPTPROV g_hProv = 0;
@@ -87,7 +87,7 @@ Gc_rc
gc_init (void)
{
#ifdef GNULIB_GC_RANDOM
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
if (g_hProv)
CryptReleaseContext (g_hProv, 0);
@@ -114,7 +114,7 @@ void
gc_done (void)
{
#ifdef GNULIB_GC_RANDOM
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
if (g_hProv)
{
CryptReleaseContext (g_hProv, 0);
@@ -133,7 +133,7 @@ gc_done (void)
static Gc_rc
randomize (int level, char *data, size_t datalen)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
if (!g_hProv)
return GC_RANDOM_ERROR;
CryptGenRandom (g_hProv, (DWORD) datalen, data);
diff --git a/lib/get-rusage-data.c b/lib/get-rusage-data.c
index 0056b9ef85..fbf50bffcf 100644
--- a/lib/get-rusage-data.c
+++ b/lib/get-rusage-data.c
@@ -353,7 +353,7 @@ vma_iterate_callback (void *data, uintptr_t start, uintptr_t end,
static uintptr_t
get_rusage_data_via_iterator (void)
{
-# if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __BEOS__ || defined __HAIKU__
+# if (defined _WIN32 && !defined __CYGWIN__) || defined __BEOS__ || defined __HAIKU__
/* On native Windows, there is no sbrk() function.
On Haiku, sbrk(0) always returns 0. */
static void *brk_value;
diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c
index 80a95dbfee..756c31b7b1 100644
--- a/lib/getaddrinfo.c
+++ b/lib/getaddrinfo.c
@@ -54,7 +54,7 @@
# define PF_UNSPEC 0
#endif
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
# define WINDOWS_NATIVE
#endif
diff --git a/lib/getdelim.c b/lib/getdelim.c
index 8ae887e531..ec50af1149 100644
--- a/lib/getdelim.c
+++ b/lib/getdelim.c
@@ -50,7 +50,7 @@
static void
alloc_failed (void)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Avoid errno problem without using the realloc module; see:
https://lists.gnu.org/r/bug-gnulib/2016-08/msg00025.html */
errno = ENOMEM;
diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c
index c6c1136fc5..ac05bc483c 100644
--- a/lib/getdtablesize.c
+++ b/lib/getdtablesize.c
@@ -20,7 +20,7 @@
/* Specification. */
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <stdio.h>
diff --git a/lib/gethostname.c b/lib/gethostname.c
index 1427e786f1..cb8e58ceee 100644
--- a/lib/gethostname.c
+++ b/lib/gethostname.c
@@ -20,7 +20,7 @@
#include <config.h>
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+#if !(defined _WIN32 && !defined __CYGWIN__)
/* Unix API. */
/* Specification. */
diff --git a/lib/getlogin.c b/lib/getlogin.c
index b97ed835a9..ab9868b221 100644
--- a/lib/getlogin.c
+++ b/lib/getlogin.c
@@ -22,7 +22,7 @@
/* Specification. */
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
@@ -30,7 +30,7 @@
char *
getlogin (void)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
static char login_name[1024];
DWORD sz = sizeof (login_name);
diff --git a/lib/getlogin_r.c b/lib/getlogin_r.c
index 812cd6b637..afd8122e66 100644
--- a/lib/getlogin_r.c
+++ b/lib/getlogin_r.c
@@ -27,7 +27,7 @@
#include "malloca.h"
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#else
@@ -41,7 +41,7 @@ int
getlogin_r (char *name, size_t size)
{
#undef getlogin_r
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows platform. */
DWORD sz;
diff --git a/lib/getopt.c b/lib/getopt.c
index d0cbbeef8b..18e9f5341a 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -46,7 +46,7 @@
/* When used standalone, flockfile and funlockfile might not be
available. */
# if (!defined _POSIX_THREAD_SAFE_FUNCTIONS \
- || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+ || (defined _WIN32 && ! defined __CYGWIN__))
# define flockfile(fp) /* nop */
# define funlockfile(fp) /* nop */
# endif
diff --git a/lib/getpagesize.c b/lib/getpagesize.c
index 2a01563493..9e79ed6691 100644
--- a/lib/getpagesize.c
+++ b/lib/getpagesize.c
@@ -23,7 +23,7 @@
#include <unistd.h>
/* This implementation is only for native Windows systems. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
diff --git a/lib/getpass.c b/lib/getpass.c
index 6b7f1cc3a3..a2113550ae 100644
--- a/lib/getpass.c
+++ b/lib/getpass.c
@@ -23,7 +23,7 @@
#include <stdio.h>
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+#if !(defined _WIN32 && !defined __CYGWIN__)
# include <stdbool.h>
diff --git a/lib/getrusage.c b/lib/getrusage.c
index 0142fd02f0..44c0a51536 100644
--- a/lib/getrusage.c
+++ b/lib/getrusage.c
@@ -28,7 +28,7 @@
/* Get uint64_t. */
#include <stdint.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -47,7 +47,7 @@ getrusage (int who, struct rusage *usage_p)
/* Clear all unsupported members of 'struct rusage'. */
memset (usage_p, '\0', sizeof (struct rusage));
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
if (who == RUSAGE_SELF)
{
/* Fill in the ru_utime and ru_stime members. */
diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c
index db6fffca06..ba0410b9d1 100644
--- a/lib/gettimeofday.c
+++ b/lib/gettimeofday.c
@@ -24,7 +24,7 @@
#include <time.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WINDOWS_NATIVE
# include <windows.h>
#endif
diff --git a/lib/glob.c b/lib/glob.c
index 29e3911f1a..61930e7149 100644
--- a/lib/glob.c
+++ b/lib/glob.c
@@ -26,7 +26,7 @@
#include <assert.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WINDOWS32
#endif
diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h
index ca3cec5b47..1e303cb79b 100644
--- a/lib/inttypes.in.h
+++ b/lib/inttypes.in.h
@@ -52,7 +52,7 @@
/* Get CHAR_BIT. */
#include <limits.h>
/* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <stdio.h>
#endif
diff --git a/lib/isapipe.c b/lib/isapipe.c
index da4248c488..445a0ad082 100644
--- a/lib/isapipe.c
+++ b/lib/isapipe.c
@@ -23,7 +23,7 @@
#include <errno.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Windows platforms. */
/* Get GetFileType. */
diff --git a/lib/javaexec.c b/lib/javaexec.c
index ab69c50c05..b6f2eff0e8 100644
--- a/lib/javaexec.c
+++ b/lib/javaexec.c
@@ -357,7 +357,7 @@ execute_java_class (const char *class_name,
}
}
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
+#if defined _WIN32 || defined __CYGWIN__
/* Native Windows, Cygwin */
{
static bool jview_tested;
diff --git a/lib/link.c b/lib/link.c
index 6f0ed0e2df..bf0b344b75 100644
--- a/lib/link.c
+++ b/lib/link.c
@@ -25,7 +25,7 @@
#include <sys/stat.h>
#if !HAVE_LINK
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
diff --git a/lib/localcharset.c b/lib/localcharset.c
index 04eaf071d6..50a5d688bf 100644
--- a/lib/localcharset.c
+++ b/lib/localcharset.c
@@ -32,7 +32,7 @@
# define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */
#endif
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
# define WINDOWS_NATIVE
# include <locale.h>
#endif
@@ -88,7 +88,7 @@
# define O_NOFOLLOW 0
#endif
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
/* Native Windows, Cygwin, OS/2, DOS */
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
#endif
diff --git a/lib/localename.c b/lib/localename.c
index f7a7fa5a73..694bd2206b 100644
--- a/lib/localename.c
+++ b/lib/localename.c
@@ -61,7 +61,7 @@ extern char * getlocalename_l(int, locale_t);
# endif
#endif
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
# define WINDOWS_NATIVE
# if !defined IN_LIBINTL
# include "glthread/lock.h"
diff --git a/lib/localename.h b/lib/localename.h
index 7c333c5a58..a7c03692f7 100644
--- a/lib/localename.h
+++ b/lib/localename.h
@@ -87,7 +87,7 @@ extern const char * gl_locale_name_environ (int category, const char *categoryna
The result must not be freed; it is statically allocated. */
extern const char * gl_locale_name_default (void)
#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE \
- || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__)
+ || defined _WIN32 || defined __CYGWIN__)
_GL_ATTRIBUTE_CONST
#endif
;
diff --git a/lib/localtime.c b/lib/localtime.c
index c94eeb0dad..fdacde61c4 100644
--- a/lib/localtime.c
+++ b/lib/localtime.c
@@ -30,7 +30,7 @@
struct tm *
rpl_localtime (const time_t *tp)
{
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* Rectify the value of the environment variable TZ.
There are four possible kinds of such values:
- Traditional US time zone names, e.g. "PST8PDT". Syntax: see
diff --git a/lib/lseek.c b/lib/lseek.c
index eb4b24e66f..5d520ce77b 100644
--- a/lib/lseek.c
+++ b/lib/lseek.c
@@ -19,7 +19,7 @@
/* Specification. */
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Windows platforms. */
/* Get GetFileType. */
# include <windows.h>
@@ -39,7 +39,7 @@
off_t
rpl_lseek (int fd, off_t offset, int whence)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* mingw lseek mistakenly succeeds on pipes, sockets, and terminals. */
HANDLE h = (HANDLE) _get_osfhandle (fd);
if (h == INVALID_HANDLE_VALUE)
diff --git a/lib/mbsinit.c b/lib/mbsinit.c
index 921cbf11cb..e23a5ad318 100644
--- a/lib/mbsinit.c
+++ b/lib/mbsinit.c
@@ -54,7 +54,7 @@ mbsinit (const mbstate_t *ps)
int
mbsinit (const mbstate_t *ps)
{
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* Native Windows. */
# ifdef __MINGW32__
/* On mingw, 'mbstate_t' is defined as 'int'. */
diff --git a/lib/mkdir.c b/lib/mkdir.c
index e99395470a..37d5a0f436 100644
--- a/lib/mkdir.c
+++ b/lib/mkdir.c
@@ -38,7 +38,7 @@
Additionally, it declares _mkdir (and depending on compile flags, an
alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
which are included in the <sys/stat.h> override. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define mkdir(name,mode) _mkdir (name)
# define maybe_unused _GL_UNUSED
#else
diff --git a/lib/msvc-nothrow.h b/lib/msvc-nothrow.h
index 853b09e0ce..5cc7c22e8f 100644
--- a/lib/msvc-nothrow.h
+++ b/lib/msvc-nothrow.h
@@ -25,7 +25,7 @@
This file defines wrappers that turn such an invalid parameter notification
into an error code. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Get original declaration of _get_osfhandle. */
# include <io.h>
diff --git a/lib/nanosleep.c b/lib/nanosleep.c
index 8c3be40221..2cc3909118 100644
--- a/lib/nanosleep.c
+++ b/lib/nanosleep.c
@@ -86,7 +86,7 @@ nanosleep (const struct timespec *requested_delay,
}
}
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
/* Native Windows platforms. */
# define WIN32_LEAN_AND_MEAN
diff --git a/lib/nl_langinfo.c b/lib/nl_langinfo.c
index d98f034623..90b26a2498 100644
--- a/lib/nl_langinfo.c
+++ b/lib/nl_langinfo.c
@@ -22,7 +22,7 @@
#include <locale.h>
#include <string.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
# include <stdio.h>
@@ -65,7 +65,7 @@ ctype_codeset (void)
}
}
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* If setlocale is successful, it returns the number of the
codepage, as a string. Otherwise, fall back on Windows API
GetACP, which returns the locale's codepage as a number (although
diff --git a/lib/nonblocking.c b/lib/nonblocking.c
index 5d5fefadeb..a325fadcc6 100644
--- a/lib/nonblocking.c
+++ b/lib/nonblocking.c
@@ -21,7 +21,7 @@
#include <errno.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
# include <sys/ioctl.h>
diff --git a/lib/nproc.c b/lib/nproc.c
index 5050635a33..41fc9ab209 100644
--- a/lib/nproc.c
+++ b/lib/nproc.c
@@ -50,7 +50,7 @@
# include <sys/sysctl.h>
#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
@@ -176,7 +176,7 @@ num_processors_via_affinity_mask (void)
}
#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
{ /* This works on native Windows platforms. */
DWORD_PTR process_mask;
DWORD_PTR system_mask;
@@ -318,7 +318,7 @@ num_processors_ignoring_omp (enum nproc_query query)
}
#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
{ /* This works on native Windows platforms. */
SYSTEM_INFO system_info;
GetSystemInfo (&system_info);
diff --git a/lib/open.c b/lib/open.c
index b344f13a92..792e258ba0 100644
--- a/lib/open.c
+++ b/lib/open.c
@@ -86,7 +86,7 @@ open (const char *filename, int flags, ...)
flags &= ~O_NONBLOCK;
#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
if (strcmp (filename, "/dev/null") == 0)
filename = "NUL";
#endif
diff --git a/lib/openpty.c b/lib/openpty.c
index f565a296cc..94e09ca011 100644
--- a/lib/openpty.c
+++ b/lib/openpty.c
@@ -32,7 +32,7 @@ rpl_openpty (int *amaster, int *aslave, char *name,
(struct winsize *) winp);
}
-#elif (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ /* mingw */
+#elif defined _WIN32 && !defined __CYGWIN__ /* mingw */
# include <errno.h>
diff --git a/lib/pathmax.h b/lib/pathmax.h
index 521f4eb17e..661a71420d 100644
--- a/lib/pathmax.h
+++ b/lib/pathmax.h
@@ -65,7 +65,7 @@
# define PATH_MAX 1024
# endif
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com,
section "Maximum Path Length Limitation",
<https://msdn.microsoft.com/en-us/library/aa365247.aspx#maxpath>
diff --git a/lib/pipe-filter-aux.c b/lib/pipe-filter-aux.c
index a33b817e94..4f1c7be9e8 100644
--- a/lib/pipe-filter-aux.c
+++ b/lib/pipe-filter-aux.c
@@ -26,7 +26,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <windows.h>
#else
# include <signal.h>
diff --git a/lib/pipe-filter-gi.c b/lib/pipe-filter-gi.c
index 7d59c362f6..85f7ea5049 100644
--- a/lib/pipe-filter-gi.c
+++ b/lib/pipe-filter-gi.c
@@ -26,7 +26,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <windows.h>
#else
# include <signal.h>
@@ -66,7 +66,7 @@ struct pipe_filter_gi
volatile bool reader_terminated;
volatile int reader_errno;
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
CRITICAL_SECTION lock; /* protects the volatile fields */
HANDLE reader_thread_handle;
#else
@@ -95,7 +95,7 @@ static void filter_cleanup (struct pipe_filter_gi *filter,
bool finish_reading);
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
static unsigned int WINAPI
@@ -221,7 +221,7 @@ filter_cleanup (struct pipe_filter_gi *filter, bool finish_reading)
static int
filter_init (struct pipe_filter_gi *filter)
{
-#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if !(defined _WIN32 && ! defined __CYGWIN__)
/* When we write to the child process and it has just terminated,
we don't want to die from a SIGPIPE signal. So set the SIGPIPE
handler to SIG_IGN, and handle EPIPE error codes in write(). */
diff --git a/lib/pipe-filter-ii.c b/lib/pipe-filter-ii.c
index 7358f27651..ab8cb90ab1 100644
--- a/lib/pipe-filter-ii.c
+++ b/lib/pipe-filter-ii.c
@@ -25,7 +25,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <windows.h>
#elif defined __KLIBC__
# define INCL_DOS
@@ -162,8 +162,7 @@ WaitForMultipleObjects (DWORD nCount, const HANDLE *pHandles, BOOL bWaitAll,
#include "pipe-filter-aux.h"
-#if (((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
- || defined __KLIBC__)
+#if (defined _WIN32 && ! defined __CYGWIN__) || defined __KLIBC__
struct locals
{
@@ -265,8 +264,7 @@ pipe_filter_ii_execute (const char *progname,
{
pid_t child;
int fd[2];
-#if !(((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
- || defined __KLIBC__)
+#if !((defined _WIN32 && ! defined __CYGWIN__) || defined __KLIBC__)
struct sigaction orig_sigpipe_action;
#endif
@@ -277,8 +275,7 @@ pipe_filter_ii_execute (const char *progname,
if (child == -1)
return -1;
-#if (((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
- || defined __KLIBC__)
+#if (defined _WIN32 && ! defined __CYGWIN__) || defined __KLIBC__
/* Native Windows API. */
/* Pipes have a non-blocking mode, see function SetNamedPipeHandleState and
the article "Named Pipe Type, Read, and Wait Modes", but Microsoft's
@@ -586,8 +583,7 @@ pipe_filter_ii_execute (const char *progname,
{
int saved_errno = errno;
close (fd[1]);
-#if !(((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
- || defined __KLIBC__)
+#if !((defined _WIN32 && ! defined __CYGWIN__) || defined __KLIBC__)
if (sigaction (SIGPIPE, &orig_sigpipe_action, NULL) < 0)
abort ();
#endif
diff --git a/lib/pipe.c b/lib/pipe.c
index 505092f5fd..6a5ec35a51 100644
--- a/lib/pipe.c
+++ b/lib/pipe.c
@@ -19,7 +19,7 @@
/* Specification. */
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
/* Get _pipe(). */
diff --git a/lib/pipe2.c b/lib/pipe2.c
index 6b1dd1ffd4..40b9940a1b 100644
--- a/lib/pipe2.c
+++ b/lib/pipe2.c
@@ -29,7 +29,7 @@
# include "nonblocking.h"
#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
# include <io.h>
@@ -73,7 +73,7 @@ pipe2 (int fd[2], int flags)
return -1;
}
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
if (_pipe (fd, 4096, flags & ~O_NONBLOCK) < 0)
@@ -152,8 +152,7 @@ pipe2 (int fd[2], int flags)
#endif
-#if GNULIB_defined_O_NONBLOCK || \
- !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if GNULIB_defined_O_NONBLOCK || !(defined _WIN32 && ! defined __CYGWIN__)
fail:
{
int saved_errno = errno;
diff --git a/lib/poll.c b/lib/poll.c
index da3d8911b7..26f7f1202a 100644
--- a/lib/poll.c
+++ b/lib/poll.c
@@ -34,7 +34,7 @@
#include <errno.h>
#include <limits.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WINDOWS_NATIVE
# include <winsock2.h>
# include <windows.h>
diff --git a/lib/popen.c b/lib/popen.c
index cecc434065..cf78d5fa71 100644
--- a/lib/popen.c
+++ b/lib/popen.c
@@ -21,7 +21,7 @@
/* Specification. */
#include <stdio.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
# include <string.h>
diff --git a/lib/posix_openpt.c b/lib/posix_openpt.c
index 7683ea602c..a9631d8eee 100644
--- a/lib/posix_openpt.c
+++ b/lib/posix_openpt.c
@@ -54,7 +54,7 @@ posix_openpt (int flags)
master = open ("/dev/ptc", flags);
-#elif (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ /* mingw */
+#elif defined _WIN32 && !defined __CYGWIN__ /* mingw */
/* Mingw lacks pseudo-terminals altogether. */
master = -1;
diff --git a/lib/printf-parse.c b/lib/printf-parse.c
index 7400ff4c1c..5ce5824620 100644
--- a/lib/printf-parse.c
+++ b/lib/printf-parse.c
@@ -419,7 +419,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
cp++;
}
#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, PRIdMAX is defined as "I64d".
We cannot change it to "lld" because PRIdMAX must also
be understood by the system's printf routines. */
diff --git a/lib/progreloc.c b/lib/progreloc.c
index f7673299ae..0e52a14be8 100644
--- a/lib/progreloc.c
+++ b/lib/progreloc.c
@@ -35,7 +35,7 @@
# include <mach-o/dyld.h>
#endif
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
# define WINDOWS_NATIVE
#endif
@@ -78,7 +78,7 @@ extern char * canonicalize_file_name (const char *name);
ISSLASH(C) tests whether C is a directory separator character.
IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
*/
-#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
+#if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
/* Native Windows, OS/2, DOS */
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
# define HAS_DEVICE(P) \
diff --git a/lib/putenv.c b/lib/putenv.c
index 556d5f8230..801e372c32 100644
--- a/lib/putenv.c
+++ b/lib/putenv.c
@@ -34,7 +34,7 @@
#include <string.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
@@ -153,7 +153,7 @@ putenv (char *string)
*ep = string;
break;
}
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
if (putenv_result == 0)
{
/* _putenv propagated "NAME= " into the subprocess environment;
diff --git a/lib/read.c b/lib/read.c
index 926cd75c98..17d9d74566 100644
--- a/lib/read.c
+++ b/lib/read.c
@@ -20,7 +20,7 @@
/* Specification. */
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <errno.h>
# include <io.h>
diff --git a/lib/relocatable.c b/lib/relocatable.c
index 4bdb9a6545..81133cae40 100644
--- a/lib/relocatable.c
+++ b/lib/relocatable.c
@@ -42,7 +42,7 @@
# include "xalloc.h"
#endif
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
@@ -77,7 +77,7 @@
ISSLASH(C) tests whether C is a directory separator character.
IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
*/
-#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
+#if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
/* Native Windows, OS/2, DOS */
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
# define HAS_DEVICE(P) \
@@ -99,7 +99,7 @@
platforms, see below. Therefore we enable it by default only on native
Windows platforms. */
#ifndef ENABLE_COSTLY_RELOCATABLE
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
# define ENABLE_COSTLY_RELOCATABLE 1
# else
# define ENABLE_COSTLY_RELOCATABLE 0
@@ -256,7 +256,7 @@ compute_curr_prefix (const char *orig_installprefix,
/* Do case-insensitive comparison if the file system is always or
often case-insensitive. It's better to accept the comparison
if the difference is only in case, rather than to fail. */
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
/* Native Windows, Cygwin, OS/2, DOS - case insignificant file system */
if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
!= (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
@@ -310,7 +310,7 @@ compute_curr_prefix (const char *orig_installprefix,
/* Full pathname of shared library, or NULL. */
static char *shared_library_fullname;
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
/* Native Windows only.
On Cygwin, it is better to use the Cygwin provided /proc interface, than
to use native Windows API and cygwin_conv_to_posix_path, because it
@@ -445,8 +445,7 @@ find_shared_library_fullname ()
static char *
get_shared_library_fullname ()
{
-#if (!((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) \
- && !defined __EMX__)
+#if !(defined _WIN32 && !defined __CYGWIN__) && !defined __EMX__
static bool tried_find_shared_library_fullname;
if (!tried_find_shared_library_fullname)
{
diff --git a/lib/rename.c b/lib/rename.c
index 53fa5fc409..0b457aa313 100644
--- a/lib/rename.c
+++ b/lib/rename.c
@@ -23,7 +23,7 @@
#undef rename
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* The mingw rename has problems with trailing slashes; it also
requires use of native Windows calls to allow atomic renames over
existing files. */
diff --git a/lib/same-inode.h b/lib/same-inode.h
index ad8f7d72ef..68377954e0 100644
--- a/lib/same-inode.h
+++ b/lib/same-inode.h
@@ -26,7 +26,7 @@
&& (a).st_ino[1] == (b).st_ino[1] \
&& (a).st_ino[2] == (b).st_ino[2] \
&& (a).st_dev == (b).st_dev)
-# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# elif defined _WIN32 && ! defined __CYGWIN__
/* Native Windows. */
# if _GL_WINDOWS_STAT_INODES
/* stat() and fstat() set st_dev and st_ino to 0 if information about
diff --git a/lib/secure_getenv.c b/lib/secure_getenv.c
index 3f9c962abb..54e5a17f5b 100644
--- a/lib/secure_getenv.c
+++ b/lib/secure_getenv.c
@@ -38,7 +38,7 @@ secure_getenv (char const *name)
if (geteuid () != getuid () || getegid () != getgid ())
return NULL;
return getenv (name);
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* native Windows */
+#elif defined _WIN32 && ! defined __CYGWIN__ /* native Windows */
/* On native Windows, there is no such concept as setuid or setgid binaries.
- Programs launched as system services have high privileges, but they don't
inherit environment variables from a user.
diff --git a/lib/select.c b/lib/select.c
index e50c06e113..3659cb5694 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -22,7 +22,7 @@
#include <alloca.h>
#include <assert.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows. */
#include <sys/types.h>
diff --git a/lib/sethostname.c b/lib/sethostname.c
index f04fa11198..6183115305 100644
--- a/lib/sethostname.c
+++ b/lib/sethostname.c
@@ -19,7 +19,7 @@
#include <config.h>
-#if !((defined _WIN32 || defined __WIN32__) || defined __CYGWIN__)
+#if !(defined _WIN32 || defined __CYGWIN__)
/* Unix API. */
/* Specification. */
diff --git a/lib/setlocale.c b/lib/setlocale.c
index 5ac7f72308..1ac3f4d66e 100644
--- a/lib/setlocale.c
+++ b/lib/setlocale.c
@@ -72,7 +72,7 @@ category_to_name (int category)
return retval;
}
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* The native Windows setlocale() function expects locale names of the form
"German" or "German_Germany" or "DEU", but not "de" or "de_DE". We need
@@ -635,7 +635,7 @@ setlocale_unixlike (int category, const char *locale)
/* The native Windows implementation of setlocale understands the special
locale name "C", but not "POSIX". Therefore map "POSIX" to "C". */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
if (locale != NULL && strcmp (locale, "POSIX") == 0)
locale = "C";
#endif
@@ -852,7 +852,7 @@ rpl_setlocale (int category, const char *locale)
if (setlocale_unixlike (LC_ALL, base_name) == NULL)
goto fail;
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, setlocale(LC_ALL,...) may succeed but set the
LC_CTYPE category to an invalid value ("C") when it does not
support the specified encoding. Report a failure instead. */
@@ -903,7 +903,7 @@ rpl_setlocale (int category, const char *locale)
}
else
{
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
if (category == LC_ALL && locale != NULL && strchr (locale, '.') != NULL)
{
char *saved_locale;
diff --git a/lib/sigaction.c b/lib/sigaction.c
index da46b1c57b..7e4af5fe55 100644
--- a/lib/sigaction.c
+++ b/lib/sigaction.c
@@ -67,7 +67,7 @@
/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias
for the signal SIGABRT. Only one signal handler is stored for both
SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# undef SIGABRT_COMPAT
# define SIGABRT_COMPAT 6
#endif
diff --git a/lib/sigprocmask.c b/lib/sigprocmask.c
index 0a8cd53283..7a49bcd115 100644
--- a/lib/sigprocmask.c
+++ b/lib/sigprocmask.c
@@ -50,7 +50,7 @@
/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias
for the signal SIGABRT. Only one signal handler is stored for both
SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# undef SIGABRT_COMPAT
# define SIGABRT_COMPAT 6
#endif
diff --git a/lib/sleep.c b/lib/sleep.c
index 0b58697587..8b7539090a 100644
--- a/lib/sleep.c
+++ b/lib/sleep.c
@@ -24,7 +24,7 @@
#include "verify.h"
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
diff --git a/lib/spawn-pipe.c b/lib/spawn-pipe.c
index 8a5956db32..716c54a6c7 100644
--- a/lib/spawn-pipe.c
+++ b/lib/spawn-pipe.c
@@ -40,8 +40,7 @@
#define _(str) gettext (str)
-#if (((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
- || defined __KLIBC__)
+#if (defined _WIN32 && ! defined __CYGWIN__) || defined __KLIBC__
/* Native Windows API. */
# include <process.h>
@@ -74,7 +73,7 @@ nonintr_close (int fd)
}
#define close nonintr_close
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
static int
nonintr_open (const char *pathname, int oflag, mode_t mode)
{
@@ -115,8 +114,7 @@ create_pipe (const char *progname,
bool slave_process, bool exit_on_error,
int fd[2])
{
-#if (((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
- || defined __KLIBC__)
+#if (defined _WIN32 && ! defined __CYGWIN__) || defined __KLIBC__
/* Native Windows API.
This uses _pipe(), dup2(), and spawnv(). It could also be implemented
diff --git a/lib/spawn-pipe.h b/lib/spawn-pipe.h
index 755356c3f4..52576d00b8 100644
--- a/lib/spawn-pipe.h
+++ b/lib/spawn-pipe.h
@@ -130,7 +130,7 @@ extern pid_t create_pipe_bidi (const char *progname,
int fd[2]);
/* The name of the "always silent" device. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
# define DEV_NULL "NUL"
#else
diff --git a/lib/spawni.c b/lib/spawni.c
index ab77dfe5e3..40f89d2db6 100644
--- a/lib/spawni.c
+++ b/lib/spawni.c
@@ -89,7 +89,7 @@
#define SPAWN_ERROR 127
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
int
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 104f537668..8e787bd3b2 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -168,7 +168,7 @@ get_stat_birthtime (struct stat const *st _GL_UNUSED)
#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
t.tv_sec = st->st_birthtime;
t.tv_nsec = st->st_birthtimensec;
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
/* Native Windows platforms (but not Cygwin) put the "file creation
time" in st_ctime (!). See
<https://msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx>. */
diff --git a/lib/stat-w32.c b/lib/stat-w32.c
index 5d76a462e1..802b38a8ef 100644
--- a/lib/stat-w32.c
+++ b/lib/stat-w32.c
@@ -18,7 +18,7 @@
#include <config.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Ensure that <windows.h> defines FILE_ID_INFO. */
#undef _WIN32_WINNT
diff --git a/lib/stat.c b/lib/stat.c
index 1c5b62e2ea..18c0caa19d 100644
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -27,7 +27,7 @@
#include <sys/stat.h>
#undef __need_system_sys_stat_h
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WINDOWS_NATIVE
#endif
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 05c5752a24..7a0ac4d50b 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -118,7 +118,7 @@
# define _flag __flag
# endif
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* newer Windows with MSVC */
+#elif defined _WIN32 && ! defined __CYGWIN__ /* newer Windows with MSVC */
/* <stdio.h> does not define the innards of FILE any more. */
# define WINDOWS_OPAQUE_FILE
diff --git a/lib/stdio-read.c b/lib/stdio-read.c
index 57c44ddb32..ed7f843bf0 100644
--- a/lib/stdio-read.c
+++ b/lib/stdio-read.c
@@ -29,7 +29,7 @@
read() function is at the basis of the function which fills the buffer of
a FILE stream. */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
# include <errno.h>
# include <io.h>
diff --git a/lib/stdio-write.c b/lib/stdio-write.c
index 5bd8d6341a..e01a780a77 100644
--- a/lib/stdio-write.c
+++ b/lib/stdio-write.c
@@ -30,7 +30,7 @@
error EINVAL. This write() function is at the basis of the function
which flushes the buffer of a FILE stream. */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
# include <errno.h>
# include <signal.h>
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index 803a57a771..53a42e6a11 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -122,7 +122,7 @@
it before we #define perror rpl_perror. */
/* But in any case avoid namespace pollution on glibc systems. */
#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
- && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+ && (defined _WIN32 && ! defined __CYGWIN__) \
&& ! defined __GLIBC__
# include <stdlib.h>
#endif
@@ -133,7 +133,7 @@
it before we #define rename rpl_rename. */
/* But in any case avoid namespace pollution on glibc systems. */
#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
- && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+ && (defined _WIN32 && ! defined __CYGWIN__) \
&& ! defined __GLIBC__
# include <io.h>
#endif
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index c8a5d0d0c6..3bf35bf6b0 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -54,7 +54,7 @@
#endif
/* Native Windows platforms declare mktemp() in <io.h>. */
-#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
# include <io.h>
#endif
@@ -90,7 +90,7 @@ struct random_data
# endif
#endif
-#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
/* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
/* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
diff --git a/lib/strerror_r.c b/lib/strerror_r.c
index c556c26737..7a11be1caf 100644
--- a/lib/strerror_r.c
+++ b/lib/strerror_r.c
@@ -61,7 +61,7 @@ int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
# define USE_SYSTEM_STRERROR 1
-# if defined __NetBSD__ || defined __hpux || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __sgi || (defined __sun && !defined _LP64) || defined __CYGWIN__
+# if defined __NetBSD__ || defined __hpux || (defined _WIN32 && !defined __CYGWIN__) || defined __sgi || (defined __sun && !defined _LP64) || defined __CYGWIN__
/* No locking needed. */
@@ -258,7 +258,7 @@ strerror_r (int errnum, char *buf, size_t buflen)
/* Try to do what strerror (errnum) does, but without clobbering the
buffer used by strerror(). */
-# if defined __NetBSD__ || defined __hpux || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __CYGWIN__ /* NetBSD, HP-UX, native Windows, Cygwin */
+# if defined __NetBSD__ || defined __hpux || (defined _WIN32 && !defined __CYGWIN__) || defined __CYGWIN__ /* NetBSD, HP-UX, native Windows, Cygwin */
/* NetBSD: sys_nerr, sys_errlist are declared through _NETBSD_SOURCE
and <errno.h> above.
@@ -335,7 +335,7 @@ strerror_r (int errnum, char *buf, size_t buflen)
#endif
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
/* MSVC 14 defines names for many error codes in the range 100..140,
but _sys_errlist contains strings only for the error codes
< _sys_nerr = 43. */
diff --git a/lib/strftime-fixes.c b/lib/strftime-fixes.c
index 47f5d9540b..43614a5f8c 100644
--- a/lib/strftime-fixes.c
+++ b/lib/strftime-fixes.c
@@ -27,7 +27,7 @@
size_t
rpl_strftime (char *buf, size_t bufsize, const char *format, const struct tm *tp)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Rectify the value of the environment variable TZ.
There are four possible kinds of such values:
- Traditional US time zone names, e.g. "PST8PDT". Syntax: see
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 140867fc82..b22c6e185e 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -57,13 +57,13 @@
/* Before doing "#define mkdir rpl_mkdir" below, we need to include all
headers that may declare mkdir(). Native Windows platforms declare mkdir
in <io.h> and/or <direct.h>, not in <unistd.h>. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <io.h> /* mingw32, mingw64 */
# include <direct.h> /* mingw64, MSVC 9 */
#endif
/* Native Windows platforms declare umask() in <io.h>. */
-#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
# include <io.h>
#endif
@@ -576,7 +576,7 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
Additionally, it declares _mkdir (and depending on compile flags, an
alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
which are included above. */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
# if !GNULIB_defined_rpl_mkdir
static int
diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h
index a002c401b6..0f75f4e107 100644
--- a/lib/sys_types.in.h
+++ b/lib/sys_types.in.h
@@ -86,8 +86,7 @@ typedef unsigned long long int rpl_ino_t;
/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */
/* But avoid namespace pollution on glibc systems. */
-#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
- && ! defined __GLIBC__
+#if (defined _WIN32 && ! defined __CYGWIN__) && ! defined __GLIBC__
# include <stddef.h>
#endif
diff --git a/lib/sys_wait.in.h b/lib/sys_wait.in.h
index 16a456e5cf..2b5cee2e9d 100644
--- a/lib/sys_wait.in.h
+++ b/lib/sys_wait.in.h
@@ -23,7 +23,7 @@
@PRAGMA_COLUMNS@
/* The include_next requires a split double-inclusion guard. */
-#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if !(defined _WIN32 && ! defined __CYGWIN__)
# @INCLUDE_NEXT@ @NEXT_SYS_WAIT_H@
#endif
@@ -39,7 +39,7 @@
/* The definition of _GL_WARN_ON_USE is copied here. */
-#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if !(defined _WIN32 && ! defined __CYGWIN__)
/* Unix API. */
/* The following macros apply to an argument x, that is a status of a process,
@@ -111,7 +111,7 @@
/* Declarations of functions. */
#if @GNULIB_WAITPID@
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
_GL_FUNCDECL_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
# endif
_GL_CXXALIAS_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
diff --git a/lib/system-quote.c b/lib/system-quote.c
index 2dabfa2893..17d7024e98 100644
--- a/lib/system-quote.c
+++ b/lib/system-quote.c
@@ -27,7 +27,7 @@
#include "sh-quote.h"
#include "xalloc.h"
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* The native Windows CreateProcess() function interprets characters like
' ', '\t', '\\', '"' (but not '<' and '>') in a special way:
@@ -188,13 +188,13 @@ system_quote_length (enum system_command_interpreter interpreter,
{
switch (interpreter)
{
-#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if !(defined _WIN32 && ! defined __CYGWIN__)
case SCI_SYSTEM:
#endif
case SCI_POSIX_SH:
return shell_quote_length (string);
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
case SCI_WINDOWS_CREATEPROCESS:
return windows_createprocess_quote (NULL, string);
@@ -216,13 +216,13 @@ system_quote_copy (char *p,
{
switch (interpreter)
{
-#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if !(defined _WIN32 && ! defined __CYGWIN__)
case SCI_SYSTEM:
#endif
case SCI_POSIX_SH:
return shell_quote_copy (p, string);
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
case SCI_WINDOWS_CREATEPROCESS:
p += windows_createprocess_quote (p, string);
*p = '\0';
@@ -247,13 +247,13 @@ system_quote (enum system_command_interpreter interpreter,
{
switch (interpreter)
{
-#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if !(defined _WIN32 && ! defined __CYGWIN__)
case SCI_SYSTEM:
#endif
case SCI_POSIX_SH:
return shell_quote (string);
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
case SCI_WINDOWS_CREATEPROCESS:
case SCI_SYSTEM:
case SCI_WINDOWS_CMD:
diff --git a/lib/system-quote.h b/lib/system-quote.h
index e6f8078fcb..564e4864e3 100644
--- a/lib/system-quote.h
+++ b/lib/system-quote.h
@@ -61,7 +61,7 @@ enum system_command_interpreter
SCI_SYSTEM = 0
/* The POSIX /bin/sh. */
, SCI_POSIX_SH = 1
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* The native Windows CreateProcess() function. */
, SCI_WINDOWS_CREATEPROCESS = 2
/* The native Windows cmd.exe interpreter. */
diff --git a/lib/tmpdir.c b/lib/tmpdir.c
index d7ee70e869..fa84965012 100644
--- a/lib/tmpdir.c
+++ b/lib/tmpdir.c
@@ -42,7 +42,7 @@
#include <sys/stat.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
#endif
@@ -60,7 +60,7 @@
/* Pathname support.
ISSLASH(C) tests whether C is a directory separator character.
*/
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
/* Native Windows, Cygwin, OS/2, DOS */
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
#else
@@ -115,7 +115,7 @@ path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
}
if (dir == NULL)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
char dirbuf[PATH_MAX];
DWORD retval;
diff --git a/lib/tzset.c b/lib/tzset.c
index 4111f30d71..5d296752b6 100644
--- a/lib/tzset.c
+++ b/lib/tzset.c
@@ -40,7 +40,7 @@ tzset (void)
struct tm save = *localtime_buffer_addr;
#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Rectify the value of the environment variable TZ.
There are four possible kinds of such values:
- Traditional US time zone names, e.g. "PST8PDT". Syntax: see
diff --git a/lib/uname.c b/lib/uname.c
index 8956340aa4..da7faad71f 100644
--- a/lib/uname.c
+++ b/lib/uname.c
@@ -20,7 +20,7 @@
#include <sys/utsname.h>
/* This file provides an implementation only for the native Windows API. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 4f2e86e5ba..98a5abe217 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -61,7 +61,7 @@
/* But avoid namespace pollution on glibc systems. */
#if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
|| ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \
- && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) \
+ && (defined _WIN32 && ! defined __CYGWIN__)) \
|| ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
&& defined __CYGWIN__)) \
&& ! defined __GLIBC__
@@ -94,13 +94,13 @@
lseek(), read(), unlink(), write() in <io.h>. */
#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
|| defined GNULIB_POSIXCHECK) \
- && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+ && (defined _WIN32 && ! defined __CYGWIN__))
# include <io.h> /* mingw32, mingw64 */
# include <direct.h> /* mingw64, MSVC 9 */
#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \
|| @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \
|| defined GNULIB_POSIXCHECK) \
- && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+ && (defined _WIN32 && ! defined __CYGWIN__)
# include <io.h>
#endif
diff --git a/lib/utime.c b/lib/utime.c
index 80291d3acb..1893c87f14 100644
--- a/lib/utime.c
+++ b/lib/utime.c
@@ -21,7 +21,7 @@
/* Specification. */
#include <utime.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <errno.h>
# include <stdbool.h>
diff --git a/lib/utime.in.h b/lib/utime.in.h
index 8a52a0d695..07fdb30952 100644
--- a/lib/utime.in.h
+++ b/lib/utime.in.h
@@ -45,7 +45,7 @@
/* The definition of _GL_WARN_ON_USE is copied here. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Define 'struct utimbuf' as an alias of 'struct _utimbuf'
(or possibly, if present, 'struct __utimbuf64'). */
diff --git a/lib/utimecmp.c b/lib/utimecmp.c
index b92797a6b6..d4234b2626 100644
--- a/lib/utimecmp.c
+++ b/lib/utimecmp.c
@@ -47,7 +47,7 @@
no greater than 1 billion. */
#if HAVE_UTIMENSAT
enum { SYSCALL_RESOLUTION = 1 };
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, file times have 100 ns resolution. See
<https://msdn.microsoft.com/en-us/library/ms724284.aspx> */
enum { SYSCALL_RESOLUTION = 100 };
diff --git a/lib/utimens.c b/lib/utimens.c
index c0b0704eb2..e65f55d82f 100644
--- a/lib/utimens.c
+++ b/lib/utimens.c
@@ -39,8 +39,7 @@
GNU Emacs, which arranges for this in some other way and which
defines WIN32_LEAN_AND_MEAN itself. */
-#if ((defined _WIN32 || defined __WIN32__) \
- && ! defined __CYGWIN__ && ! defined EMACS_CONFIGURATION)
+#if defined _WIN32 && ! defined __CYGWIN__ && ! defined EMACS_CONFIGURATION
# define USE_SETFILETIME
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 155b16ea04..56ffbe308a 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -4243,7 +4243,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
static const wchar_t decimal_format[] =
/* Produce the same number of exponent digits
as the native printf implementation. */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
{ '%', '+', '.', '3', 'd', '\0' };
# else
{ '%', '+', '.', '2', 'd', '\0' };
@@ -4257,7 +4257,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
static const char decimal_format[] =
/* Produce the same number of exponent digits
as the native printf implementation. */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
"%+.3d";
# else
"%+.2d";
@@ -4436,7 +4436,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
static const wchar_t decimal_format[] =
/* Produce the same number of exponent digits
as the native printf implementation. */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
{ '%', '+', '.', '3', 'd', '\0' };
# else
{ '%', '+', '.', '2', 'd', '\0' };
@@ -4450,7 +4450,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
static const char decimal_format[] =
/* Produce the same number of exponent digits
as the native printf implementation. */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
"%+.3d";
# else
"%+.2d";
@@ -4508,7 +4508,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
*p++ = '+';
/* Produce the same number of exponent digits as
the native printf implementation. */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
*p++ = '0';
# endif
*p++ = '0';
@@ -4836,7 +4836,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#if HAVE_LONG_LONG_INT
case TYPE_LONGLONGINT:
case TYPE_ULONGLONGINT:
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
*fbp++ = 'I';
*fbp++ = '6';
*fbp++ = '4';
@@ -4872,7 +4872,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \
&& !defined __UCLIBC__) \
|| (defined __APPLE__ && defined __MACH__) \
- || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+ || (defined _WIN32 && ! defined __CYGWIN__))
fbp[1] = '%';
fbp[2] = 'n';
fbp[3] = '\0';
diff --git a/lib/vma-iter.c b/lib/vma-iter.c
index 6045f21d76..b98b0415fe 100644
--- a/lib/vma-iter.c
+++ b/lib/vma-iter.c
@@ -86,7 +86,7 @@
# include <mach/mach.h>
#endif
-#if (defined _WIN32 || defined __WIN32__) || defined __CYGWIN__ /* Windows */
+#if defined _WIN32 || defined __CYGWIN__ /* Windows */
# include <windows.h>
#endif
@@ -1397,7 +1397,7 @@ vma_iterate (vma_iterate_callback_fn callback, void *data)
}
return 0;
-#elif (defined _WIN32 || defined __WIN32__) || defined __CYGWIN__
+#elif defined _WIN32 || defined __CYGWIN__
/* Windows platform. Use the native Windows API. */
MEMORY_BASIC_INFORMATION info;
diff --git a/lib/vma-iter.h b/lib/vma-iter.h
index fae3b13f90..1b46d9b19a 100644
--- a/lib/vma-iter.h
+++ b/lib/vma-iter.h
@@ -52,7 +52,7 @@ extern int vma_iterate (vma_iterate_callback_fn callback, void *data);
this platform.
Note that even when this macro is defined, vma_iterate() may still fail to
find any virtual memory area, for example if /proc is not mounted. */
-#if defined __linux__ || defined __GNU__ || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined __sgi || defined __osf__ || defined __sun || HAVE_PSTAT_GETPROCVM || (defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __WIN32__) || defined __CYGWIN__ || defined __BEOS__ || defined __HAIKU__ || defined __minix || HAVE_MQUERY
+#if defined __linux__ || defined __GNU__ || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined __sgi || defined __osf__ || defined __sun || HAVE_PSTAT_GETPROCVM || (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __CYGWIN__ || defined __BEOS__ || defined __HAIKU__ || defined __minix || HAVE_MQUERY
# define VMA_ITERATE_SUPPORTED 1
#endif
diff --git a/lib/wait-process.c b/lib/wait-process.c
index 1926bf54d7..9e59c08dd8 100644
--- a/lib/wait-process.c
+++ b/lib/wait-process.c
@@ -39,7 +39,7 @@
#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
diff --git a/lib/wcsftime.c b/lib/wcsftime.c
index 00d8e61efb..c0c006aec8 100644
--- a/lib/wcsftime.c
+++ b/lib/wcsftime.c
@@ -28,7 +28,7 @@
size_t
rpl_wcsftime (wchar_t *buf, size_t bufsize, const wchar_t *format, const struct tm *tp)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Rectify the value of the environment variable TZ.
There are four possible kinds of such values:
- Traditional US time zone names, e.g. "PST8PDT". Syntax: see
diff --git a/lib/wctype.in.h b/lib/wctype.in.h
index 502b8c4569..928fc2d5f1 100644
--- a/lib/wctype.in.h
+++ b/lib/wctype.in.h
@@ -60,7 +60,7 @@
isw* functions in <ctype.h>, <wchar.h> as well as in <wctype.h>. Include
<ctype.h>, <wchar.h> in advance to avoid rpl_ prefix being added to the
declarations. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <ctype.h>
# include <wchar.h>
#endif
diff --git a/lib/write.c b/lib/write.c
index 92b36ad81a..06166241e6 100644
--- a/lib/write.c
+++ b/lib/write.c
@@ -25,7 +25,7 @@
GetLastError() = ERROR_NO_DATA, and write() in consequence fails with
error EINVAL. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <errno.h>
# include <signal.h>
diff --git a/m4/csharpexec.m4 b/m4/csharpexec.m4
index 2e5fbcfdf7..f645ffdc47 100644
--- a/m4/csharpexec.m4
+++ b/m4/csharpexec.m4
@@ -1,4 +1,4 @@
-# csharpexec.m4 serial 5
+# csharpexec.m4 serial 6
dnl Copyright (C) 2003-2005, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,7 @@ AC_DEFUN([gt_CSHARPEXEC],
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_MSG_CHECKING([for C[#] program execution engine])
AC_EGREP_CPP([yes], [
-#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __EMX__ || defined __DJGPP__
yes
#endif
], MONO_PATH_SEPARATOR=';', MONO_PATH_SEPARATOR=':')
diff --git a/m4/getcwd.m4 b/m4/getcwd.m4
index 2875fe590b..019934d580 100644
--- a/m4/getcwd.m4
+++ b/m4/getcwd.m4
@@ -6,7 +6,7 @@
# with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert.
-# serial 15
+# serial 16
AC_DEFUN([gl_FUNC_GETCWD_NULL],
[
@@ -25,7 +25,7 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
char *getcwd ();
# endif
]], [[
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* mingw cwd does not start with '/', but getcwd does allocate.
However, mingw fails to honor non-zero size. */
#else
diff --git a/m4/javacomp.m4 b/m4/javacomp.m4
index c4d650bfdc..bee333ea7b 100644
--- a/m4/javacomp.m4
+++ b/m4/javacomp.m4
@@ -1,4 +1,4 @@
-# javacomp.m4 serial 15
+# javacomp.m4 serial 16
dnl Copyright (C) 2001-2003, 2006-2007, 2009-2018 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -83,7 +83,7 @@ AC_DEFUN([gt_JAVACOMP],
[
ifelse([$2], [], [AC_REQUIRE([gt_JAVAEXEC])], [])
AC_EGREP_CPP([yes], [
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
yes
#endif
], CLASSPATH_SEPARATOR=';', CLASSPATH_SEPARATOR=':')
diff --git a/m4/javaexec.m4 b/m4/javaexec.m4
index 1dcf005e53..aefe2bce4b 100644
--- a/m4/javaexec.m4
+++ b/m4/javaexec.m4
@@ -1,4 +1,4 @@
-# javaexec.m4 serial 5
+# javaexec.m4 serial 6
dnl Copyright (C) 2001-2003, 2006, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,7 @@ AC_DEFUN([gt_JAVAEXEC],
[
AC_MSG_CHECKING([for Java virtual machine])
AC_EGREP_CPP([yes], [
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
yes
#endif
], CLASSPATH_SEPARATOR=';', CLASSPATH_SEPARATOR=':')
diff --git a/m4/locale-ar.m4 b/m4/locale-ar.m4
index 3024441546..ee386b9adc 100644
--- a/m4/locale-ar.m4
+++ b/m4/locale-ar.m4
@@ -1,4 +1,4 @@
-# locale-ar.m4 serial 7
+# locale-ar.m4 serial 8
dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -31,7 +31,7 @@ int main () {
return 1;
#else
/* Check whether the given locale name is recognized by the system. */
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
diff --git a/m4/locale-fr.m4 b/m4/locale-fr.m4
index 30a1d94bdc..a37a0d2024 100644
--- a/m4/locale-fr.m4
+++ b/m4/locale-fr.m4
@@ -1,4 +1,4 @@
-# locale-fr.m4 serial 18
+# locale-fr.m4 serial 19
dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -31,7 +31,7 @@ int main () {
return 1;
#else
/* Check whether the given locale name is recognized by the system. */
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -160,7 +160,7 @@ int main () {
variables, and all locales use the UTF-8 encoding. */
#if !(defined __BEOS__ || defined __HAIKU__)
/* Check whether the given locale name is recognized by the system. */
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
diff --git a/m4/locale-ja.m4 b/m4/locale-ja.m4
index 2c34006296..9f1623191d 100644
--- a/m4/locale-ja.m4
+++ b/m4/locale-ja.m4
@@ -1,4 +1,4 @@
-# locale-ja.m4 serial 13
+# locale-ja.m4 serial 14
dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -32,7 +32,7 @@ int main ()
return 1;
#else
/* Check whether the given locale name is recognized by the system. */
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
diff --git a/m4/locale-tr.m4 b/m4/locale-tr.m4
index 441cae6817..2f2cf47892 100644
--- a/m4/locale-tr.m4
+++ b/m4/locale-tr.m4
@@ -1,4 +1,4 @@
-# locale-tr.m4 serial 10
+# locale-tr.m4 serial 11
dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -30,7 +30,7 @@ int main () {
implement the Turkish upper-/lowercase mappings. Therefore, let this
program return 1 on BeOS. */
/* Check whether the given locale name is recognized by the system. */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
diff --git a/m4/locale-zh.m4 b/m4/locale-zh.m4
index f7e1901d0d..cfb447f08d 100644
--- a/m4/locale-zh.m4
+++ b/m4/locale-zh.m4
@@ -1,4 +1,4 @@
-# locale-zh.m4 serial 13
+# locale-zh.m4 serial 14
dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -33,7 +33,7 @@ int main ()
return 1;
#else
/* Check whether the given locale name is recognized by the system. */
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
diff --git a/m4/malloc.m4 b/m4/malloc.m4
index 0ded9ba219..4c182b4140 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,4 +1,4 @@
-# malloc.m4 serial 16
+# malloc.m4 serial 17
dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -91,7 +91,7 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[]],
- [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ [[#if defined _WIN32 && ! defined __CYGWIN__
choke me
#endif
]])],
diff --git a/m4/nocrash.m4 b/m4/nocrash.m4
index 87b2d4cbf6..49140074d0 100644
--- a/m4/nocrash.m4
+++ b/m4/nocrash.m4
@@ -1,4 +1,4 @@
-# nocrash.m4 serial 4
+# nocrash.m4 serial 5
dnl Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -79,7 +79,7 @@ nocrash_init (void)
}
}
}
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
/* Avoid a crash on native Windows. */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
diff --git a/m4/pathmax.m4 b/m4/pathmax.m4
index 403a37534d..292a256971 100644
--- a/m4/pathmax.m4
+++ b/m4/pathmax.m4
@@ -1,4 +1,4 @@
-# pathmax.m4 serial 10
+# pathmax.m4 serial 11
dnl Copyright (C) 2002-2003, 2005-2006, 2009-2018 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -29,7 +29,7 @@ AC_DEFUN([gl_PATHMAX_SNIPPET], [[
# undef PATH_MAX
# define PATH_MAX 1024
#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# undef PATH_MAX
# define PATH_MAX 260
#endif
diff --git a/m4/ptsname_r.m4 b/m4/ptsname_r.m4
index 879b833372..10b4dff509 100644
--- a/m4/ptsname_r.m4
+++ b/m4/ptsname_r.m4
@@ -1,4 +1,4 @@
-# ptsname_r.m4 serial 4
+# ptsname_r.m4 serial 5
dnl Copyright (C) 2010-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -54,7 +54,7 @@ AC_DEFUN([gl_PREREQ_PTSNAME_R], [
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <errno.h>
- #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ #if defined _WIN32 && ! defined __CYGWIN__
# include <io.h>
#else
# include <unistd.h>
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index e06461e693..0debe69e92 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 48
+# stdio_h.m4 serial 49
dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -28,7 +28,7 @@ AC_DEFUN([gl_STDIO_H],
/* For non-mingw systems, compilation will trivially succeed.
For mingw, compilation will succeed for older mingw (system
printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
- #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \
+ #if (defined _WIN32 && ! defined __CYGWIN__) && \
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
#endif
diff --git a/m4/tmpfile.m4 b/m4/tmpfile.m4
index 0735feb7b3..043dd38ac0 100644
--- a/m4/tmpfile.m4
+++ b/m4/tmpfile.m4
@@ -1,4 +1,4 @@
-# tmpfile.m4 serial 2
+# tmpfile.m4 serial 3
# Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -23,7 +23,7 @@ AC_DEFUN([gl_FUNC_TMPFILE], [
AC_CACHE_CHECK([whether tmpfile should be overridden],
[gl_cv_func_tmpfile_unusable],
[AC_EGREP_CPP([choke me], [
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
choke me
#endif
],
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index b3b71ec270..77110a93dd 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 71
+# unistd_h.m4 serial 72
dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -37,7 +37,7 @@ AC_DEFUN([gl_UNISTD_H],
# include <fcntl.h>
# include <stdio.h>
# include <stdlib.h>
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
# include <io.h>
# endif
#endif
diff --git a/tests/nap.h b/tests/nap.h
index 97a3cca548..a155af3a12 100644
--- a/tests/nap.h
+++ b/tests/nap.h
@@ -64,7 +64,7 @@ nap_get_stat (struct stat *st, int do_write)
if (do_write)
{
ASSERT (write (nap_fd, "\n", 1) == 1);
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the modification times are not changed until NAP_FD
is closed. See
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365747(v=vs.85).aspx */
diff --git a/tests/test-cloexec.c b/tests/test-cloexec.c
index 6d91154e87..8f8fcf6fcd 100644
--- a/tests/test-cloexec.c
+++ b/tests/test-cloexec.c
@@ -24,7 +24,7 @@
#include <fcntl.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -43,7 +43,7 @@
static int
is_inheritable (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
@@ -90,7 +90,7 @@ main (void)
/* Normal use of set_cloexec_flag. */
ASSERT (set_cloexec_flag (fd, true) == 0);
-#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if !(defined _WIN32 && ! defined __CYGWIN__)
ASSERT (!is_inheritable (fd));
#endif
ASSERT (set_cloexec_flag (fd, false) == 0);
diff --git a/tests/test-dup-safer.c b/tests/test-dup-safer.c
index 5fb38cb882..223509fe5e 100644
--- a/tests/test-dup-safer.c
+++ b/tests/test-dup-safer.c
@@ -29,7 +29,7 @@
#include "binary-io.h"
#include "cloexec.h"
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -60,7 +60,7 @@ static FILE *myerr;
static bool
is_open (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
@@ -77,7 +77,7 @@ is_open (int fd)
static bool
is_inheritable (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
diff --git a/tests/test-dup2.c b/tests/test-dup2.c
index 90fbeb94d6..665425462b 100644
--- a/tests/test-dup2.c
+++ b/tests/test-dup2.c
@@ -36,7 +36,7 @@ SIGNATURE_CHECK (dup2, int, (int, int));
# include "cloexec.h"
#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -54,7 +54,7 @@ SIGNATURE_CHECK (dup2, int, (int, int));
static int
is_open (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
@@ -72,7 +72,7 @@ is_open (int fd)
static int
is_inheritable (int fd)
{
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
diff --git a/tests/test-dup3.c b/tests/test-dup3.c
index aed888cf0b..87c1ca463a 100644
--- a/tests/test-dup3.c
+++ b/tests/test-dup3.c
@@ -28,7 +28,7 @@ SIGNATURE_CHECK (dup3, int, (int, int, int));
#include <fcntl.h>
#include <stdbool.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -47,7 +47,7 @@ SIGNATURE_CHECK (dup3, int, (int, int, int));
static bool
is_open (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
@@ -64,7 +64,7 @@ is_open (int fd)
static bool
is_cloexec (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
HANDLE h = (HANDLE) _get_osfhandle (fd);
DWORD flags;
ASSERT (GetHandleInformation (h, &flags));
diff --git a/tests/test-fcntl.c b/tests/test-fcntl.c
index 476231be20..5d6467403f 100644
--- a/tests/test-fcntl.c
+++ b/tests/test-fcntl.c
@@ -30,7 +30,7 @@ SIGNATURE_CHECK (fcntl, int, (int, int, ...));
#include <stdbool.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -54,7 +54,7 @@ static int zero (void) { return 0; }
static bool
is_open (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
@@ -71,7 +71,7 @@ is_open (int fd)
static bool
is_inheritable (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
diff --git a/tests/test-get-rusage-data.c b/tests/test-get-rusage-data.c
index ea631ca2e9..e030c77782 100644
--- a/tests/test-get-rusage-data.c
+++ b/tests/test-get-rusage-data.c
@@ -55,7 +55,7 @@ main ()
ASSERT (value2 >= value1);
ASSERT (value3 >= value2);
-#if !(__GLIBC__ == 2 || (defined __APPLE__ && defined __MACH__) || defined __DragonFly__ || defined __OpenBSD__ || (defined _WIN32 || defined __WIN32__) || defined __CYGWIN__)
+#if !(__GLIBC__ == 2 || (defined __APPLE__ && defined __MACH__) || defined __DragonFly__ || defined __OpenBSD__ || defined _WIN32 || defined __CYGWIN__)
/* Allocating 2.5 MB of memory should increase the data segment size. */
ASSERT (value3 > value1);
#endif
diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c
index 0fa666b02f..8e42ccfc13 100644
--- a/tests/test-getaddrinfo.c
+++ b/tests/test-getaddrinfo.c
@@ -26,7 +26,7 @@ SIGNATURE_CHECK (gai_strerror, char const *, (int));
/* On native Windows, these two functions may have the __stdcall calling
convention. But the SIGNATURE_CHECK works only for functions with __cdecl
calling convention. */
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+#if !(defined _WIN32 && !defined __CYGWIN__)
SIGNATURE_CHECK (freeaddrinfo, void, (struct addrinfo *));
SIGNATURE_CHECK (getaddrinfo, int, (char const *, char const *,
struct addrinfo const *,
diff --git a/tests/test-getlogin.h b/tests/test-getlogin.h
index c77d360f4b..61a57400db 100644
--- a/tests/test-getlogin.h
+++ b/tests/test-getlogin.h
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+#if !(defined _WIN32 && !defined __CYGWIN__)
# include <pwd.h>
#endif
@@ -55,7 +55,7 @@ test_getlogin_result (const char *buf, int err)
}
/* Compare against the value from the environment. */
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+#if !(defined _WIN32 && !defined __CYGWIN__)
/* Unix platform */
{
struct stat stat_buf;
@@ -79,7 +79,7 @@ test_getlogin_result (const char *buf, int err)
ASSERT (pwd->pw_uid == stat_buf.st_uid);
}
#endif
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
/* Native Windows platform.
Note: This test would fail on Cygwin in an ssh session, because sshd
sets USERNAME=SYSTEM. */
diff --git a/tests/test-isatty.c b/tests/test-isatty.c
index 58ebbe0610..a2dd176085 100644
--- a/tests/test-isatty.c
+++ b/tests/test-isatty.c
@@ -27,7 +27,7 @@ SIGNATURE_CHECK (isatty, int, (int));
#include "macros.h"
/* The name of the "always silent" device. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
# define DEV_NULL "NUL"
#else
diff --git a/tests/test-localename.c b/tests/test-localename.c
index 7e866c74ec..4e8d146b4b 100644
--- a/tests/test-localename.c
+++ b/tests/test-localename.c
@@ -155,7 +155,7 @@ test_locale_name (void)
if (setlocale (LC_ALL, "") != NULL)
{
name = gl_locale_name (LC_CTYPE, "LC_CTYPE");
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, here,
gl_locale_name_thread (LC_CTYPE, "LC_CTYPE")
returns NULL and
@@ -584,7 +584,7 @@ test_locale_name_posix (void)
if (setlocale (LC_ALL, "") != NULL)
{
name = gl_locale_name_posix (LC_CTYPE, "LC_CTYPE");
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
ASSERT (strcmp (name, "de_DE") == 0 || strcmp (name, "de_DE.UTF-8") == 0);
#else
ASSERT (strcmp (name, "de_DE.UTF-8") == 0);
@@ -750,7 +750,7 @@ test_locale_name_default (void)
/* Only Mac OS X and Windows have a facility for the user to set the default
locale. */
-#if !((defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __WIN32__ || defined __CYGWIN__))
+#if !((defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __CYGWIN__))
ASSERT (strcmp (name, "C") == 0);
#endif
diff --git a/tests/test-mbrtowc-w32.c b/tests/test-mbrtowc-w32.c
index 2f83386efe..ba4d755f67 100644
--- a/tests/test-mbrtowc-w32.c
+++ b/tests/test-mbrtowc-w32.c
@@ -26,7 +26,7 @@
#include "macros.h"
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
static int
test_one_locale (const char *name, int codepage)
diff --git a/tests/test-nonblocking-pipe-main.c b/tests/test-nonblocking-pipe-main.c
index e8a1f547e1..b847b99b86 100644
--- a/tests/test-nonblocking-pipe-main.c
+++ b/tests/test-nonblocking-pipe-main.c
@@ -24,7 +24,7 @@
#include <unistd.h>
#include <sys/time.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <process.h>
#else
# include <spawn.h>
@@ -81,7 +81,7 @@ main (int argc, char *argv[])
child_argv[1] = argv[2];
child_argv[2] = NULL;
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
child = spawnvpe (P_NOWAIT, child_path, child_argv,
(const char **) environ);
ASSERT (child >= 0);
diff --git a/tests/test-nonblocking-socket-main.c b/tests/test-nonblocking-socket-main.c
index fe5000cf69..6c0e96d093 100644
--- a/tests/test-nonblocking-socket-main.c
+++ b/tests/test-nonblocking-socket-main.c
@@ -25,7 +25,7 @@
#include <sys/time.h>
#include <sys/socket.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <process.h>
#else
# include <spawn.h>
@@ -68,7 +68,7 @@ main (int argc, char *argv[])
child_argv[2] = port_arg;
child_argv[3] = NULL;
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
child = spawnvpe (P_NOWAIT, child_path, child_argv,
(const char **) environ);
ASSERT (child >= 0);
diff --git a/tests/test-nonblocking-socket.h b/tests/test-nonblocking-socket.h
index aff99a84c4..d1a0fd75d7 100644
--- a/tests/test-nonblocking-socket.h
+++ b/tests/test-nonblocking-socket.h
@@ -44,7 +44,7 @@
sockets have very large buffers in the kernel, so that write() calls
succeed before the reader has started reading, even if fd is blocking
and the amount of data is larger than 1 MB. */
-#if defined __linux__ || (defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __WIN32__) || defined __CYGWIN__
+#if defined __linux__ || (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __CYGWIN__
# define SOCKET_HAS_LARGE_BUFFER 1
#else
# define SOCKET_HAS_LARGE_BUFFER 0
diff --git a/tests/test-nonblocking.c b/tests/test-nonblocking.c
index d0f18cd0d1..27ec4e78b8 100644
--- a/tests/test-nonblocking.c
+++ b/tests/test-nonblocking.c
@@ -85,7 +85,7 @@ main (void)
bool sock_works = true;
int fd_sock;
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* For now, we can't get nonblocking status of windows sockets. */
sock_works = false;
# endif
diff --git a/tests/test-pipe.c b/tests/test-pipe.c
index b39af7f16b..55f62089e4 100644
--- a/tests/test-pipe.c
+++ b/tests/test-pipe.c
@@ -24,7 +24,7 @@ SIGNATURE_CHECK (pipe, int, (int[2]));
#include <fcntl.h>
#include <stdbool.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -43,7 +43,7 @@ SIGNATURE_CHECK (pipe, int, (int[2]));
static bool
is_open (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
@@ -60,7 +60,7 @@ is_open (int fd)
static bool
is_cloexec (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
HANDLE h = (HANDLE) _get_osfhandle (fd);
DWORD flags;
ASSERT (GetHandleInformation (h, &flags));
@@ -76,7 +76,7 @@ is_cloexec (int fd)
static bool
is_nonblocking (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* We don't use the non-blocking mode for sockets here. */
return 0;
#else
diff --git a/tests/test-pipe2.c b/tests/test-pipe2.c
index d1632eea07..4fd347deba 100644
--- a/tests/test-pipe2.c
+++ b/tests/test-pipe2.c
@@ -24,7 +24,7 @@ SIGNATURE_CHECK (pipe2, int, (int[2], int));
#include <fcntl.h>
#include <stdbool.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -46,7 +46,7 @@ SIGNATURE_CHECK (pipe2, int, (int[2], int));
static bool
is_open (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
@@ -63,7 +63,7 @@ is_open (int fd)
static bool
is_cloexec (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
HANDLE h = (HANDLE) _get_osfhandle (fd);
DWORD flags;
ASSERT (GetHandleInformation (h, &flags));
@@ -79,7 +79,7 @@ is_cloexec (int fd)
static int
get_nonblocking_flag (int fd)
{
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
return 0;
# else
# ifndef F_GETFL
diff --git a/tests/test-poll.c b/tests/test-poll.c
index ebace0f186..5dce09e643 100644
--- a/tests/test-poll.c
+++ b/tests/test-poll.c
@@ -37,7 +37,7 @@ SIGNATURE_CHECK (poll, int, (struct pollfd[], nfds_t, int));
#include "macros.h"
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WINDOWS_NATIVE
#endif
diff --git a/tests/test-pthread_sigmask1.c b/tests/test-pthread_sigmask1.c
index fc4d3d0707..92edb7758e 100644
--- a/tests/test-pthread_sigmask1.c
+++ b/tests/test-pthread_sigmask1.c
@@ -30,7 +30,7 @@ SIGNATURE_CHECK (pthread_sigmask, int, (int, const sigset_t *, sigset_t *));
#include "macros.h"
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+#if !(defined _WIN32 && !defined __CYGWIN__)
static volatile int sigint_occurred;
diff --git a/tests/test-select.h b/tests/test-select.h
index 364687b6c5..eae26b0d15 100644
--- a/tests/test-select.h
+++ b/tests/test-select.h
@@ -30,7 +30,7 @@
#include "macros.h"
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WINDOWS_NATIVE
#endif
diff --git a/tests/test-sethostname2.c b/tests/test-sethostname2.c
index 50f0916e54..671a36a9c4 100644
--- a/tests/test-sethostname2.c
+++ b/tests/test-sethostname2.c
@@ -93,7 +93,7 @@ main (int argc, char *argv[] _GL_UNUSED)
/* On Windows, a hostname change becomes effective only after
a reboot. */
-#if !((defined _WIN32 || defined __WIN32__) || defined __CYGWIN__)
+#if !(defined _WIN32 || defined __CYGWIN__)
/* if we don't get back what we put in, there is no need to
restore the original name as we will assume it was not
diff --git a/tests/test-sigprocmask.c b/tests/test-sigprocmask.c
index bf8e3a6316..7b09bb10d7 100644
--- a/tests/test-sigprocmask.c
+++ b/tests/test-sigprocmask.c
@@ -30,7 +30,7 @@ SIGNATURE_CHECK (sigprocmask, int, (int, const sigset_t *, sigset_t *));
#include "macros.h"
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+#if !(defined _WIN32 && !defined __CYGWIN__)
static volatile int sigint_occurred;
diff --git a/tests/test-spawn-pipe-child.c b/tests/test-spawn-pipe-child.c
index dfbc2da47f..14522f5af2 100644
--- a/tests/test-spawn-pipe-child.c
+++ b/tests/test-spawn-pipe-child.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -53,7 +53,7 @@ static FILE *myerr;
static int
is_open (int fd)
{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
diff --git a/tests/test-stat-time.c b/tests/test-stat-time.c
index 23cf303c30..49d5497d91 100644
--- a/tests/test-stat-time.c
+++ b/tests/test-stat-time.c
@@ -167,7 +167,7 @@ test_mtime (const struct stat *statinfo, struct timespec *modtimes)
}
}
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
/* Skip the ctime tests on native Windows platforms, because their
st_ctime is either the same as st_mtime (plus or minus an offset)
or set to the file _creation_ time, and is not influenced by rename
diff --git a/tests/test-system-quote-main.c b/tests/test-system-quote-main.c
index 2e81799778..b0326ae542 100644
--- a/tests/test-system-quote-main.c
+++ b/tests/test-system-quote-main.c
@@ -21,7 +21,7 @@
/* Specification. */
#include "system-quote.h"
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
# define WINDOWS_NATIVE
#endif
diff --git a/tests/test-utimens-common.h b/tests/test-utimens-common.h
index 5a3f268226..57f4016586 100644
--- a/tests/test-utimens-common.h
+++ b/tests/test-utimens-common.h
@@ -49,7 +49,7 @@ enum {
: 0)
};
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* Skip ctime tests on native Windows, since it is either a copy of
mtime or birth time (depending on the file system), rather than a
properly tracked change time. See
diff --git a/tests/test-wcrtomb-w32.c b/tests/test-wcrtomb-w32.c
index e8576c740f..19770d1b5e 100644
--- a/tests/test-wcrtomb-w32.c
+++ b/tests/test-wcrtomb-w32.c
@@ -25,7 +25,7 @@
#include "macros.h"
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
static int
test_one_locale (const char *name, int codepage)