Commit 3f195417 authored by Alex Brainman's avatar Alex Brainman

runtime: use go generate for zcallback_windows.go

replacement for CL 180640043

Change-Id: I8ff36645cfcbbda338faf7b29cbfdb95c47d5ec4
Reviewed-on: https://go-review.googlesource.com/1765Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 895e4b85
// 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()
}
// generated by wincallback.go; run go generate
package runtime
const cb_max = 2000 // maximum number of windows callbacks allowed
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