]> Cypherpunks repositories - gostls13.git/commitdiff
build: test for _WIN32, not _MINGW32
authorJoe Poirier <jdpoirier@gmail.com>
Thu, 9 Sep 2010 02:20:35 +0000 (22:20 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 9 Sep 2010 02:20:35 +0000 (22:20 -0400)
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

src/cmd/cc/lex.c
src/cmd/godefs/main.c
src/lib9/dirfwstat.c
src/lib9/dirstat.c
src/lib9/time.c
src/libbio/bseek.c
src/libcgo/386.S
src/libcgo/amd64.S

index c9facc667e98a12c572b3032f24097706d17c0fc..fd74edb9d28b8b655fbc4ec1e75c7ef9dc5f9d71 100644 (file)
@@ -38,7 +38,7 @@
 int
 systemtype(int sys)
 {
-#ifdef __MINGW32__
+#ifdef _WIN32
        return sys&Windows;
 #else
        return sys&Plan9;
index 6ff542f4897d046c8c2716417eb95ed343e10c19..d31d298a5e1b1075eb9834dedb4140fb6d83a0a0 100644 (file)
@@ -82,7 +82,7 @@
 
 #include "a.h"
 
-#ifdef __MINGW32__
+#ifdef _WIN32
 int
 spawn(char *prog, char **argv)
 {
index 15f1c12520566abf1979f788d19b28c94ca22c07..fe9153b9b7e965950e084bd7fd5d162d1ece57a7 100644 (file)
@@ -61,7 +61,7 @@ dirfwstat(int fd, Dir *dir)
        struct timeval tv[2];
 
        ret = 0;
-#ifndef __MINGW32__
+#ifndef _WIN32
        if(~dir->mode != 0){
                if(fchmod(fd, dir->mode) < 0)
                        ret = -1;
index 6c476753b0afab543b2e33da4e388b1d417cb76e..6d804ca7c7f902e6a5175b44ea4621ef59b9020b 100644 (file)
@@ -39,7 +39,7 @@ dirstat(char *file)
        Dir *d;
        char *str;
 
-#ifdef __MINGW32__
+#ifdef _WIN32
        if(stat(file, &st) < 0)
                return nil;
        lst = st;
index 720dd702eb21fd1ae191b696a9ed5a36bbd5517a..7394e9e603729ba80210e3fbcf9a52ca2f51a21c 100644 (file)
@@ -25,7 +25,7 @@ THE SOFTWARE.
 #include <u.h>
 #include <sys/time.h>
 #include <time.h>
-#ifndef __MINGW32__
+#ifndef _WIN32
 #include <sys/resource.h>
 #endif
 #define NOPLAN9DEFINES
@@ -34,7 +34,7 @@ THE SOFTWARE.
 long
 p9times(long *t)
 {
-#ifdef __MINGW32__
+#ifdef _WIN32
        memset(t, 0, 4*sizeof(long));
 #else
        struct rusage ru, cru;
index be00ab1a7df91f37c6effab4e7a35cab8372b933..29149810895d3f5c27019bca38f4cc9f34ea1b0b 100644 (file)
@@ -33,7 +33,7 @@ Bseek(Biobuf *bp, vlong offset, int base)
        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();
index cca79cdd516d55a430b807092056e2c73c30c9ec..02cbe34534761b30d9d2045ae3095360c0e9704d 100755 (executable)
@@ -5,7 +5,7 @@
 /*
  * 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
index 178c33cde06b57a4f0b4d97e2ac79fca670c9c63..083c2bc9417abd24051c3a9bf9ac1f115ad74ad3 100644 (file)
@@ -5,7 +5,7 @@
 /*
  * 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