diff options
author | Russ Cox <rsc@golang.org> | 2014-11-18 12:07:50 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-11-18 12:07:50 -0500 |
commit | 034ade9ba71b180de226866c5b95e71cc9e6effb (patch) | |
tree | c1914a5943bed7c96b371d7329aefc1cb725b06f /src/runtime/runtime2.go | |
parent | 684c00066a8b11bfa39b02449864841025a793d7 (diff) | |
download | go-034ade9ba71b180de226866c5b95e71cc9e6effb.tar.gz |
[dev.cc] runtime: generate GOOS- and GOARCH-specific files with go generate
Eventually I'd like almost everything cmd/dist generates
to be done with 'go generate' and checked in, to simplify
the bootstrap process. The only thing cmd/dist really needs
to do is write things like the current experiment info and
the current version.
This is a first step toward that. It replaces the _NaCl etc
constants with generated ones goos_nacl, goos_darwin,
goarch_386, and so on.
LGTM=dave, austin
R=austin, dave, bradfitz
CC=golang-codereviews, iant, r
https://codereview.appspot.com/174290043
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r-- | src/runtime/runtime2.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index c999b3072..7987a7373 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -45,7 +45,13 @@ const ( _Pdead ) -// XXX inserting below here +// The next line makes 'go generate' write the zgen_*.go files with +// per-OS and per-arch information, including constants +// named goos_$GOOS and goarch_$GOARCH for every +// known GOOS and GOARCH. The constant is 1 on the +// current system, 0 otherwise; multiplying by them is +// useful for defining GOOS- or GOARCH-specific constants. +//go:generate go run gengoos.go type mutex struct { // Futex-based impl treats it as uint32 key, @@ -395,14 +401,6 @@ type itab struct { fun [0]uintptr } -const ( - // TODO: Generate in cmd/dist. - _NaCl = 0 - _Windows = 0 - _Solaris = 0 - _Plan9 = 0 -) - // Lock-free stack node. type lfnode struct { next *lfnode |