replacement for CL
180640043
Change-Id: I8ff36645cfcbbda338faf7b29cbfdb95c47d5ec4
Reviewed-on: https://go-review.googlesource.com/1765
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
+++ /dev/null
-// 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)
const maxCallback = 2000
-func main() {
+func genasm() {
var buf bytes.Buffer
buf.WriteString(`// generated by wincallback.go; run go generate
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()
+}
--- /dev/null
+// generated by wincallback.go; run go generate
+
+package runtime
+
+const cb_max = 2000 // maximum number of windows callbacks allowed