aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Brainman <alex.brainman@gmail.com>2011-11-15 12:48:22 -0500
committerRuss Cox <rsc@golang.org>2011-11-15 12:48:22 -0500
commit0d37998a06b5f5fddbdbe0aed4cbb7536b4201f6 (patch)
tree949b3911649a3c7615a7bce4b6be755f8fc09f80
parentd03611f628c65321b572ab0d4ce85cc61b759fc6 (diff)
downloadgo-0d37998a06b5f5fddbdbe0aed4cbb7536b4201f6.tar.gz
go-0d37998a06b5f5fddbdbe0aed4cbb7536b4201f6.zip
syscall: make windows build again after d3963c0fca78 change
R=rsc, mikioh.mikioh CC=golang-dev https://golang.org/cl/5373097
-rw-r--r--src/pkg/os/exec_windows.go9
-rw-r--r--src/pkg/os/file_windows.go3
-rw-r--r--src/pkg/runtime/windows/thread.c8
-rw-r--r--src/pkg/syscall/env_windows.go1
-rwxr-xr-xsrc/pkg/syscall/mkerrors_windows.sh4
-rw-r--r--src/pkg/syscall/syscall_windows.go5
-rw-r--r--src/pkg/syscall/zerrors_windows.go2
7 files changed, 14 insertions, 18 deletions
diff --git a/src/pkg/os/exec_windows.go b/src/pkg/os/exec_windows.go
index 46adb050d8..c4c9dcfe82 100644
--- a/src/pkg/os/exec_windows.go
+++ b/src/pkg/os/exec_windows.go
@@ -8,6 +8,7 @@ import (
"errors"
"runtime"
"syscall"
+ "unsafe"
)
func (p *Process) Wait(options int) (w *Waitmsg, err error) {
@@ -68,14 +69,14 @@ func FindProcess(pid int) (p *Process, err error) {
func init() {
var argc int32
- cmd := GetCommandLine()
- argv, e := CommandLineToArgv(cmd, &argc)
+ cmd := syscall.GetCommandLine()
+ argv, e := syscall.CommandLineToArgv(cmd, &argc)
if e != nil {
return
}
- defer LocalFree(Handle(uintptr(unsafe.Pointer(argv))))
+ defer syscall.LocalFree(syscall.Handle(uintptr(unsafe.Pointer(argv))))
Args = make([]string, argc)
for i, v := range (*argv)[:argc] {
- Args[i] = string(UTF16ToString((*v)[:]))
+ Args[i] = string(syscall.UTF16ToString((*v)[:]))
}
}
diff --git a/src/pkg/os/file_windows.go b/src/pkg/os/file_windows.go
index 5b098880f4..94624266f8 100644
--- a/src/pkg/os/file_windows.go
+++ b/src/pkg/os/file_windows.go
@@ -9,6 +9,7 @@ import (
"runtime"
"sync"
"syscall"
+ "unicode/utf16"
)
// File represents an open file descriptor.
@@ -299,7 +300,7 @@ func Pipe() (r *File, w *File, err error) {
// TempDir returns the default directory to use for temporary files.
func TempDir() string {
const pathSep = '\\'
- dirw := make([]uint16, MAX_PATH)
+ dirw := make([]uint16, syscall.MAX_PATH)
n, _ := syscall.GetTempPath(uint32(len(dirw)), &dirw[0])
if n > uint32(len(dirw)) {
dirw = make([]uint16, n)
diff --git a/src/pkg/runtime/windows/thread.c b/src/pkg/runtime/windows/thread.c
index aec78509d5..9abc9cd728 100644
--- a/src/pkg/runtime/windows/thread.c
+++ b/src/pkg/runtime/windows/thread.c
@@ -81,7 +81,7 @@ runtime·osinit(void)
void
runtime·goenvs(void)
{
- extern Slice os·Envs;
+ extern Slice syscall·envs;
uint16 *env;
String *s;
@@ -101,9 +101,9 @@ runtime·goenvs(void)
s[i] = runtime·gostringw(p);
p += runtime·findnullw(p)+1;
}
- os·Envs.array = (byte*)s;
- os·Envs.len = n;
- os·Envs.cap = n;
+ syscall·envs.array = (byte*)s;
+ syscall·envs.len = n;
+ syscall·envs.cap = n;
runtime·stdcall(runtime·FreeEnvironmentStringsW, 1, env);
}
diff --git a/src/pkg/syscall/env_windows.go b/src/pkg/syscall/env_windows.go
index 8c1c4271a2..8308f10a2d 100644
--- a/src/pkg/syscall/env_windows.go
+++ b/src/pkg/syscall/env_windows.go
@@ -7,7 +7,6 @@
package syscall
import (
- "errors"
"unicode/utf16"
"unsafe"
)
diff --git a/src/pkg/syscall/mkerrors_windows.sh b/src/pkg/syscall/mkerrors_windows.sh
index a76f250fda..13badcd92e 100755
--- a/src/pkg/syscall/mkerrors_windows.sh
+++ b/src/pkg/syscall/mkerrors_windows.sh
@@ -158,7 +158,7 @@ main(void)
printf("\n// Go names for Windows errors.\n");
printf("const (\n");
for(i=0; i<nelem(goerrors); i++) {
- printf("\t%s = %s\n", goerrors[i].goname, goerrors[i].winname);
+ printf("\t%s Errno = %s\n", goerrors[i].goname, goerrors[i].winname);
}
printf(")\n");
@@ -171,7 +171,7 @@ main(void)
for(i=0; i<nelem(errors); i++) {
printf("\t%s", errors[i].name);
if(iota) {
- printf(" = APPLICATION_ERROR + iota");
+ printf(" Errno = APPLICATION_ERROR + iota");
iota = !iota;
}
printf("\n");
diff --git a/src/pkg/syscall/syscall_windows.go b/src/pkg/syscall/syscall_windows.go
index 2c0cc5401f..de3cb6d49a 100644
--- a/src/pkg/syscall/syscall_windows.go
+++ b/src/pkg/syscall/syscall_windows.go
@@ -357,11 +357,6 @@ func Gettimeofday(tv *Timeval) (err error) {
return nil
}
-func Sleep(nsec int64) (err error) {
- sleep(uint32((nsec + 1e6 - 1) / 1e6)) // round up to milliseconds
- return nil
-}
-
func Pipe(p []Handle) (err error) {
if len(p) != 2 {
return EINVAL
diff --git a/src/pkg/syscall/zerrors_windows.go b/src/pkg/syscall/zerrors_windows.go
index 24d862f230..afdeae2bc6 100644
--- a/src/pkg/syscall/zerrors_windows.go
+++ b/src/pkg/syscall/zerrors_windows.go
@@ -1,4 +1,4 @@
-// mkerrors_windows.sh -f -m32
+// mkerrors_windows.sh -m32
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package syscall