Commit 44b65c48 authored by Bruno Haible's avatar Bruno Haible

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.
parent 9d0f7475
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.
......@@ -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)
{
......
......@@ -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;
......
......@@ -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
......
......@@ -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 ())
......
......@@ -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__
......
......@@ -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
......
......@@ -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' \
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......
......@@ -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) \
......
......@@ -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. */
......
......@@ -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
......
......@@ -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
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -20,7 +20,7 @@
/* Specification. */
#include <unistd.h>
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
#if defined _WIN32 && ! defined __CYGWIN__
# include <stdio.h>
......
......@@ -20,7 +20,7 @@
#include <config.h>
#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
#if !(defined _WIN32 && !defined __CYGWIN__)
/* Unix API. */
/* Specification. */
......
......@@ -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);
......
......@@ -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;
......
......@@ -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
......
......@@ -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>
......
......@@ -23,7 +23,7 @@
#include <stdio.h>
#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
#if !(defined _WIN32 && !defined __CYGWIN__)
# include <stdbool.h>
......
......@@ -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. */
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -23,7 +23,7 @@
#include <errno.h>
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
#if defined _WIN32 && ! defined __CYGWIN__
/* Windows platforms. */
/* Get GetFileType. */
......
......@@ -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;
......
......@@ -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>
......
......@@ -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
......
......@@ -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"
......
......@@ -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
;
......
......@@ -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
......