mirror of
https://github.com/golang/go
synced 2024-11-18 16:04:44 -07:00
runtime: use go generate for zcallback_windows.go
replacement for CL 180640043 Change-Id: I8ff36645cfcbbda338faf7b29cbfdb95c47d5ec4 Reviewed-on: https://go-review.googlesource.com/1765 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
895e4b8550
commit
3f19541752
@ -1,8 +0,0 @@
|
||||
// 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 runtime
|
||||
|
||||
// TODO(brainman): move generation of zsys_windows_*.s out from cmd/dist/buildruntime.c and into here
|
||||
const cb_max = 2000 // maximum number of windows callbacks allowed (must be in sync with MAXWINCB from cmd/dist/buildruntime.c)
|
@ -17,7 +17,7 @@ import (
|
||||
|
||||
const maxCallback = 2000
|
||||
|
||||
func main() {
|
||||
func genasm() {
|
||||
var buf bytes.Buffer
|
||||
|
||||
buf.WriteString(`// generated by wincallback.go; run go generate
|
||||
@ -41,3 +41,24 @@ TEXT runtime·callbackasm(SB),7,$0
|
||||
os.Exit(2)
|
||||
}
|
||||
}
|
||||
|
||||
func gengo() {
|
||||
var buf bytes.Buffer
|
||||
|
||||
buf.WriteString(fmt.Sprintf(`// generated by wincallback.go; run go generate
|
||||
|
||||
package runtime
|
||||
|
||||
const cb_max = %d // maximum number of windows callbacks allowed
|
||||
`, maxCallback))
|
||||
err := ioutil.WriteFile("zcallback_windows.go", buf.Bytes(), 0666)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "wincallback: %s\n", err)
|
||||
os.Exit(2)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
genasm()
|
||||
gengo()
|
||||
}
|
||||
|
5
src/runtime/zcallback_windows.go
Normal file
5
src/runtime/zcallback_windows.go
Normal file
@ -0,0 +1,5 @@
|
||||
// generated by wincallback.go; run go generate
|
||||
|
||||
package runtime
|
||||
|
||||
const cb_max = 2000 // maximum number of windows callbacks allowed
|
Loading…
Reference in New Issue
Block a user