Commit e71fc0c1 authored by Alex Brainman's avatar Alex Brainman

syscall: rearrange windows code so 386 and amd64 can share files

R=golang-dev, r
CC=golang-dev, vcc.163
https://golang.org/cl/4641093
parent ae19943e
......@@ -84,5 +84,5 @@ include ../../Make.pkg
signal_unix.go: ../syscall/zerrors_$(GOOS)_$(GOARCH).go
./mkunixsignals.sh $< > $@ || rm -f $@
signal_windows.go: ../syscall/ztypes_$(GOOS)_$(GOARCH).go
signal_windows.go: ../syscall/ztypes_$(GOOS).go
./mkunixsignals.sh $< > $@ || rm -f $@
......@@ -41,6 +41,8 @@ GOFILES_linux=\
GOFILES_windows=\
exec_windows.go\
zerrors_windows.go\
ztypes_windows.go\
GOFILES_plan9=\
exec_plan9.go\
......
......@@ -3,5 +3,5 @@
// license that can be found in the LICENSE file.
//
// System calls for 386, Windows are implemented in ../runtime/windows/syscall.cgo
// System calls for 386, Windows are implemented in ../runtime/windows/syscall.goc
//
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// System calls for amd64, Windows are implemented in ../runtime/windows/syscall.goc
//
......@@ -78,6 +78,7 @@ GOOSARCH="${GOOS}_${GOARCH}"
# defaults
mksyscall="./mksyscall.pl"
mkerrors="./mkerrors.sh"
zerrors="zerrors_$GOOSARCH.go"
run="sh"
case "$1" in
......@@ -150,6 +151,14 @@ windows_386)
mksysnum=
mktypes=
mkerrors="./mkerrors_windows.sh -f -m32"
zerrors="zerrors_windows.go"
;;
windows_amd64)
mksyscall="./mksyscall_windows.pl"
mksysnum=
mktypes=
mkerrors="./mkerrors_windows.sh -f -m32"
zerrors="zerrors_windows.go"
;;
plan9_386)
mkerrors=
......@@ -164,7 +173,7 @@ plan9_386)
esac
(
if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >zerrors_$GOOSARCH.go"; fi
if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi
syscall_goos="syscall_$GOOS.go"
case "$GOOS" in
darwin | freebsd)
......
......@@ -100,6 +100,8 @@ func getSysProcAddr(m uintptr, pname string) uintptr {
return p
}
func Getpagesize() int { return 4096 }
// Converts a Go function to a function pointer conforming
// to the stdcall calling convention. This is useful when
// interoperating with Windows code requiring callbacks.
......
......@@ -3,5 +3,3 @@
// license that can be found in the LICENSE file.
package syscall
func Getpagesize() int { return 4096 }
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall
This diff is collapsed.
This diff is collapsed.
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall
// mksyscall_windows.pl
// mksyscall_windows.pl -l32 syscall_windows.go syscall_windows_386.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package syscall
......
This diff is collapsed.
// nothing to see here
package syscall
This diff is collapsed.
This diff is collapsed.
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment