Use OS rather than compiler specific flag the same way that
__FreeBSD__, __APPLE__, __OpenBSD__, and __linux__ are used.
_WIN32 is defined by GCC (and others) on windows for Win32
and Win64 applications. _WIN32 is set by default for several
other windows based compilers: DMC, MSVC, Intel, Watcom, LCC.
Although the change is for consistency, it allows the Go tools
to be compiled with non-Mingw GCC distributions and non-GCC
compilers that support the GCC extensions.
R=rsc, brainman, vcc
CC=golang-dev
https://golang.org/cl/
2168043
int
systemtype(int sys)
{
-#ifdef __MINGW32__
+#ifdef _WIN32
return sys&Windows;
#else
return sys&Plan9;
#include "a.h"
-#ifdef __MINGW32__
+#ifdef _WIN32
int
spawn(char *prog, char **argv)
{
struct timeval tv[2];
ret = 0;
-#ifndef __MINGW32__
+#ifndef _WIN32
if(~dir->mode != 0){
if(fchmod(fd, dir->mode) < 0)
ret = -1;
Dir *d;
char *str;
-#ifdef __MINGW32__
+#ifdef _WIN32
if(stat(file, &st) < 0)
return nil;
lst = st;
#include <u.h>
#include <sys/time.h>
#include <time.h>
-#ifndef __MINGW32__
+#ifndef _WIN32
#include <sys/resource.h>
#endif
#define NOPLAN9DEFINES
long
p9times(long *t)
{
-#ifdef __MINGW32__
+#ifdef _WIN32
memset(t, 0, 4*sizeof(long));
#else
struct rusage ru, cru;
vlong n, d;
int bufsz;
-#ifndef __MINGW32__
+#ifndef _WIN32
if(sizeof(offset) != sizeof(off_t)) {
fprint(2, "Bseek: libbio compiled with %d-byte offset\n", sizeof(off_t));
abort();
/*
* Apple still insists on underscore prefixes for C function names.
*/
-#if defined(__APPLE__) || defined(__MINGW32__)
+#if defined(__APPLE__) || defined(_WIN32)
#define EXT(s) _##s
#else
#define EXT(s) s
/*
* Apple still insists on underscore prefixes for C function names.
*/
-#if defined(__APPLE__) || defined(__MINGW64__)
+#if defined(__APPLE__) || defined(_WIN32)
#define EXT(s) _##s
#else
#define EXT(s) s