1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:54:40 -07:00

rename GOOS=mingw to GOOS=windows

R=rsc, Joe Poirier
CC=golang-dev
https://golang.org/cl/1015043
This commit is contained in:
Alex Brainman 2010-04-29 23:45:14 -07:00 committed by Russ Cox
parent 7906e31167
commit f81d471940
37 changed files with 48 additions and 48 deletions

View File

@ -168,7 +168,7 @@ main(int argc, char *argv[])
if(strcmp(goos, "freebsd") == 0) if(strcmp(goos, "freebsd") == 0)
HEADTYPE = 9; HEADTYPE = 9;
else else
if(strcmp(goos, "mingw") == 0) if(strcmp(goos, "windows") == 0)
HEADTYPE = 10; HEADTYPE = 10;
else else
if(strcmp(goos, "pchw") == 0) if(strcmp(goos, "pchw") == 0)

View File

@ -45,10 +45,10 @@ esac
GOOS=${GOOS:-$(uname | tr A-Z a-z)} GOOS=${GOOS:-$(uname | tr A-Z a-z)}
case "$GOOS" in case "$GOOS" in
darwin | freebsd | linux | mingw | nacl) darwin | freebsd | linux | windows | nacl)
;; ;;
*) *)
echo '$GOOS is set to <'$GOOS'>, must be darwin, freebsd, linux, mingw, or nacl' 1>&2 echo '$GOOS is set to <'$GOOS'>, must be darwin, freebsd, linux, windows, or nacl' 1>&2
exit 1 exit 1
esac esac

View File

@ -81,7 +81,7 @@ LIB9OFILES=\
time.$O\ time.$O\
tokenize.$O\ tokenize.$O\
ifeq ($(GOOS),mingw) ifeq ($(GOOS),windows)
LIB9OFILES+=\ LIB9OFILES+=\
win32.$O\ win32.$O\

View File

@ -23,7 +23,7 @@ CFLAGS_amd64=-m64
LDFLAGS_linux=-shared -lpthread -lm LDFLAGS_linux=-shared -lpthread -lm
LDFLAGS_darwin=-dynamiclib -Wl,-undefined,dynamic_lookup /usr/lib/libpthread.dylib LDFLAGS_darwin=-dynamiclib -Wl,-undefined,dynamic_lookup /usr/lib/libpthread.dylib
LDFLAGS_freebsd=-pthread -shared -lm LDFLAGS_freebsd=-pthread -shared -lm
LDFLAGS_mingw=-shared -lm -mthreads LDFLAGS_windows=-shared -lm -mthreads
%.o: %.c %.o: %.c
gcc $(CFLAGS_$(GOARCH)) -O2 -fPIC -o $@ -c $*.c gcc $(CFLAGS_$(GOARCH)) -O2 -fPIC -o $@ -c $*.c

View File

@ -48,7 +48,7 @@ OFILES=\
6obj.$O\ 6obj.$O\
8obj.$O\ 8obj.$O\
ifneq ($(GOOS),mingw) ifneq ($(GOOS),windows)
OFILES+=\ OFILES+=\
$(shell uname | tr A-Z a-z).$O\ $(shell uname | tr A-Z a-z).$O\

View File

@ -6,10 +6,10 @@ package proc
import "os" import "os"
// Process tracing is not supported on MinGW yet. // Process tracing is not supported on windows yet.
func Attach(pid int) (Process, os.Error) { func Attach(pid int) (Process, os.Error) {
return nil, os.NewError("debug/proc not implemented on MinGW") return nil, os.NewError("debug/proc not implemented on windows")
} }
func ForkExec(argv0 string, argv []string, envv []string, dir string, fd []*os.File) (Process, os.Error) { func ForkExec(argv0 string, argv []string, envv []string, dir string, fd []*os.File) (Process, os.Error) {

View File

@ -34,9 +34,9 @@ GOFILES_nacl=\
file_unix.go\ file_unix.go\
sys_nacl.go\ sys_nacl.go\
GOFILES_mingw=\ GOFILES_windows=\
file_mingw.go\ file_windows.go\
sys_mingw.go\ sys_windows.go\
GOFILES+=$(GOFILES_$(GOOS)) GOFILES+=$(GOFILES_$(GOOS))

View File

@ -17,7 +17,7 @@ CFLAGS_64=-D_64BIT
# TODO(kaib): fix register allocation to honor extern register so we # TODO(kaib): fix register allocation to honor extern register so we
# can enable optimizations again. # can enable optimizations again.
CFLAGS_arm=-N CFLAGS_arm=-N
CFLAGS_mingw=-D__MINGW__ CFLAGS_windows=-D__WINDOWS__
CFLAGS=-I$(GOOS) -I$(GOARCH) -I$(GOOS)/$(GOARCH) -wF $(CFLAGS_$(SIZE)) $(CFLAGS_$(GOARCH)) $(CFLAGS_$(GOOS)) CFLAGS=-I$(GOOS) -I$(GOARCH) -I$(GOOS)/$(GOARCH) -wF $(CFLAGS_$(SIZE)) $(CFLAGS_$(GOARCH)) $(CFLAGS_$(GOOS))
GOFILES=\ GOFILES=\
@ -29,7 +29,7 @@ GOFILES=\
GOFILES_pchw=\ GOFILES_pchw=\
pchw/io.go\ pchw/io.go\
OFILES_mingw=\ OFILES_windows=\
syscall.$O\ syscall.$O\
# 386-specific object files # 386-specific object files

View File

@ -19,7 +19,7 @@ case "$GOARCH" in
# ../../libcgo/linux_386.c:/^start # ../../libcgo/linux_386.c:/^start
# ../../libcgo/darwin_386.c:/^start # ../../libcgo/darwin_386.c:/^start
case "$GOOS" in case "$GOOS" in
mingw) windows)
echo '#define get_tls(r) MOVL 0x2c(FS), r' echo '#define get_tls(r) MOVL 0x2c(FS), r'
echo '#define g(r) 0(r)' echo '#define g(r) 0(r)'
echo '#define m(r) 4(r)' echo '#define m(r) 4(r)'

View File

@ -117,7 +117,7 @@ enum
struct Lock struct Lock
{ {
uint32 key; uint32 key;
#ifdef __MINGW__ #ifdef __WINDOWS__
void* event; void* event;
#else #else
uint32 sema; // for OS X uint32 sema; // for OS X
@ -231,7 +231,7 @@ struct M
MCache *mcache; MCache *mcache;
G* lockedg; G* lockedg;
uint64 freg[8]; // Floating point register storage used by ARM software fp routines uint64 freg[8]; // Floating point register storage used by ARM software fp routines
#ifdef __MINGW__ #ifdef __WINDOWS__
void* return_address; // saved return address and stack void* return_address; // saved return address and stack
void* stack_pointer; // pointer for Windows stdcall void* stack_pointer; // pointer for Windows stdcall
void* os_stack_pointer; void* os_stack_pointer;

View File

@ -39,7 +39,7 @@ walksymtab(void (*fn)(Sym*))
if(symdat == nil) if(symdat == nil)
return; return;
#ifdef __MINGW__ #ifdef __WINDOWS__
v = get_symdat_addr(); v = get_symdat_addr();
p = (byte*)v+8; p = (byte*)v+8;
#else #else
@ -256,7 +256,7 @@ splitpcln(void)
return; return;
// pc/ln table bounds // pc/ln table bounds
#ifdef __MINGW__ #ifdef __WINDOWS__
v = get_symdat_addr(); v = get_symdat_addr();
p = (byte*)v+8; p = (byte*)v+8;
#else #else

View File

@ -2,5 +2,5 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
TEXT _rt0_386_mingw(SB),7,$0 TEXT _rt0_386_windows(SB),7,$0
JMP _rt0_386(SB) JMP _rt0_386(SB)

View File

@ -16,8 +16,8 @@ extern void *LoadLibraryEx;
extern void *GetProcAddress; extern void *GetProcAddress;
extern void *GetLastError; extern void *GetLastError;
#define goargs mingw_goargs #define goargs windows_goargs
void mingw_goargs(void); void windows_goargs(void);
// Get start address of symbol data in memory. // Get start address of symbol data in memory.
void *get_symdat_addr(void); void *get_symdat_addr(void);

View File

@ -80,7 +80,7 @@ get_proc_addr(void *library, void *name)
} }
void void
mingw_goargs(void) windows_goargs(void)
{ {
extern Slice os·Args; extern Slice os·Args;
extern Slice os·Envs; extern Slice os·Envs;

View File

@ -3,5 +3,5 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// //
// System calls for 386, Windows are implemented in ../runtime/mingw/syscall.cgo // System calls for 386, Windows are implemented in ../runtime/windows/syscall.cgo
// //

View File

@ -150,8 +150,8 @@ linux_arm)
mktypes="godefs -gsyscall -carm-gcc" mktypes="godefs -gsyscall -carm-gcc"
mkerrors="./mkerrors.sh" mkerrors="./mkerrors.sh"
;; ;;
mingw_386) windows_386)
mksyscall="./mksyscall_mingw.sh -l32" mksyscall="./mksyscall_windows.sh -l32"
mksysnum= mksysnum=
mktypes= mktypes=
mkerrors= mkerrors=

View File

@ -23,7 +23,7 @@
# //sys LoadLibrary(libname string) (handle uint32, errno int) [failretval=-1] = LoadLibraryA # //sys LoadLibrary(libname string) (handle uint32, errno int) [failretval=-1] = LoadLibraryA
# and is 0 by default. # and is 0 by default.
$cmdline = "mksyscall_mingw.sh " . join(' ', @ARGV); $cmdline = "mksyscall_windows.sh " . join(' ', @ARGV);
$errors = 0; $errors = 0;
$_32bit = ""; $_32bit = "";
@ -36,7 +36,7 @@ if($ARGV[0] eq "-b32") {
} }
if($ARGV[0] =~ /^-/) { if($ARGV[0] =~ /^-/) {
print STDERR "usage: mksyscall_mingw.sh [-b32 | -l32] [file ...]\n"; print STDERR "usage: mksyscall_windows.sh [-b32 | -l32] [file ...]\n";
exit 1; exit 1;
} }

View File

@ -11,7 +11,7 @@ import (
"utf16" "utf16"
) )
const OS = "mingw" const OS = "windows"
/* /*
@ -72,7 +72,7 @@ func StringToUTF16Ptr(s string) *uint16 { return &StringToUTF16(s)[0] }
// dll helpers // dll helpers
// implemented in ../pkg/runtime/mingw/syscall.cgo // implemented in ../pkg/runtime/windows/syscall.cgo
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, lasterr uintptr) func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, lasterr uintptr)
func loadlibraryex(filename uintptr) (handle uint32) func loadlibraryex(filename uintptr) (handle uint32)
func getprocaddress(handle uint32, procname uintptr) (proc uintptr) func getprocaddress(handle uint32, procname uintptr) (proc uintptr)
@ -134,7 +134,7 @@ func Sleep(nsec int64) (errno int) {
} }
func Errstr(errno int) string { func Errstr(errno int) string {
if errno == EMINGW { if errno == EWINDOWS {
return "not supported by windows" return "not supported by windows"
} }
b := make([]uint16, 300) b := make([]uint16, 300)
@ -381,32 +381,32 @@ const (
func Getpid() (pid int) { return -1 } func Getpid() (pid int) { return -1 }
func Getppid() (ppid int) { return -1 } func Getppid() (ppid int) { return -1 }
func Fchdir(fd int) (errno int) { return EMINGW } func Fchdir(fd int) (errno int) { return EWINDOWS }
func Link(oldpath, newpath string) (errno int) { return EMINGW } func Link(oldpath, newpath string) (errno int) { return EWINDOWS }
func Symlink(path, link string) (errno int) { return EMINGW } func Symlink(path, link string) (errno int) { return EWINDOWS }
func Readlink(path string, buf []byte) (n int, errno int) { return 0, EMINGW } func Readlink(path string, buf []byte) (n int, errno int) { return 0, EWINDOWS }
func Chmod(path string, mode int) (errno int) { return EMINGW } func Chmod(path string, mode int) (errno int) { return EWINDOWS }
func Fchmod(fd int, mode int) (errno int) { return EMINGW } func Fchmod(fd int, mode int) (errno int) { return EWINDOWS }
func Chown(path string, uid int, gid int) (errno int) { return EMINGW } func Chown(path string, uid int, gid int) (errno int) { return EWINDOWS }
func Lchown(path string, uid int, gid int) (errno int) { return EMINGW } func Lchown(path string, uid int, gid int) (errno int) { return EWINDOWS }
func Fchown(fd int, uid int, gid int) (errno int) { return EMINGW } func Fchown(fd int, uid int, gid int) (errno int) { return EWINDOWS }
func Getuid() (uid int) { return -1 } func Getuid() (uid int) { return -1 }
func Geteuid() (euid int) { return -1 } func Geteuid() (euid int) { return -1 }
func Getgid() (gid int) { return -1 } func Getgid() (gid int) { return -1 }
func Getegid() (egid int) { return -1 } func Getegid() (egid int) { return -1 }
func Getgroups() (gids []int, errno int) { return nil, EMINGW } func Getgroups() (gids []int, errno int) { return nil, EWINDOWS }
// TODO(brainman): fix all this meaningless code, it is here to compile exec.go // TODO(brainman): fix all this meaningless code, it is here to compile exec.go
func Pipe(p []int) (errno int) { return EMINGW } func Pipe(p []int) (errno int) { return EWINDOWS }
func read(fd int, buf *byte, nbuf int) (n int, errno int) { func read(fd int, buf *byte, nbuf int) (n int, errno int) {
return 0, EMINGW return 0, EWINDOWS
} }
func fcntl(fd, cmd, arg int) (val int, errno int) { func fcntl(fd, cmd, arg int) (val int, errno int) {
return 0, EMINGW return 0, EWINDOWS
} }
const ( const (
@ -439,7 +439,7 @@ type Rusage struct {
} }
func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, errno int) { func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, errno int) {
return 0, EMINGW return 0, EWINDOWS
} }
type WaitStatus uint32 type WaitStatus uint32

View File

@ -3,7 +3,7 @@
package syscall package syscall
// TODO(brainman): populate errors in zerrors_mingw.go // TODO(brainman): populate errors in zerrors_windows.go
const ( const (
ERROR_FILE_NOT_FOUND = 2 ERROR_FILE_NOT_FOUND = 2
@ -12,8 +12,8 @@ const (
ERROR_MOD_NOT_FOUND = 126 ERROR_MOD_NOT_FOUND = 126
ERROR_PROC_NOT_FOUND = 127 ERROR_PROC_NOT_FOUND = 127
ERROR_DIRECTORY = 267 ERROR_DIRECTORY = 267
// TODO(brainman): should use value for EMINGW that does not clashes with anything else // TODO(brainman): should use value for EWINDOWS that does not clashes with anything else
EMINGW = 99999 /* otherwise unused */ EWINDOWS = 99999 /* otherwise unused */
) )
// TODO(brainman): fix all needed for os // TODO(brainman): fix all needed for os

View File

@ -4,7 +4,7 @@
package syscall package syscall
// TODO(brainman): autogenerate types in ztypes_mingw_386.go // TODO(brainman): autogenerate types in ztypes_windows_386.go
//import "unsafe" //import "unsafe"