mirror of
https://github.com/golang/go
synced 2024-11-19 13:04:45 -07:00
runtime/internal/sys: use standard generated code header
This change implements the convention for generated code header agreed upon in https://golang.org/s/generatedcode. Additionally run go generate. Also update some comments. Updates #13560 Change-Id: If45f91b93aaa0d43280c2c4630823bc4d2dc7d3a Reviewed-on: https://go-review.googlesource.com/60250 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
2915e44dac
commit
0592a1a3de
@ -30,7 +30,7 @@ func main() {
|
||||
if strings.HasPrefix(line, goosPrefix) {
|
||||
text, err := strconv.Unquote(strings.TrimPrefix(line, goosPrefix))
|
||||
if err != nil {
|
||||
log.Fatalf("parsing goosList %#q: %v", strings.TrimPrefix(line, goosPrefix), err)
|
||||
log.Fatalf("parsing goosList: %v", err)
|
||||
}
|
||||
gooses = strings.Fields(text)
|
||||
}
|
||||
@ -45,10 +45,11 @@ func main() {
|
||||
|
||||
for _, target := range gooses {
|
||||
var buf bytes.Buffer
|
||||
fmt.Fprintf(&buf, "// generated by gengoos.go using 'go generate'\n\n")
|
||||
fmt.Fprintf(&buf, "// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.\n\n")
|
||||
if target == "linux" {
|
||||
fmt.Fprintf(&buf, "// +build !android\n\n") // must explicitly exclude android for linux
|
||||
fmt.Fprintf(&buf, "// +build !android\n") // must explicitly exclude android for linux
|
||||
}
|
||||
fmt.Fprintf(&buf, "// +build %s\n\n", target) // must explicitly include target for bootstrapping purposes
|
||||
fmt.Fprintf(&buf, "package sys\n\n")
|
||||
fmt.Fprintf(&buf, "const GOOS = `%s`\n\n", target)
|
||||
for _, goos := range gooses {
|
||||
@ -66,7 +67,8 @@ func main() {
|
||||
|
||||
for _, target := range goarches {
|
||||
var buf bytes.Buffer
|
||||
fmt.Fprintf(&buf, "// generated by gengoos.go using 'go generate'\n\n")
|
||||
fmt.Fprintf(&buf, "// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.\n\n")
|
||||
fmt.Fprintf(&buf, "// +build %s\n\n", target) // must explicitly include target for bootstrapping purposes
|
||||
fmt.Fprintf(&buf, "package sys\n\n")
|
||||
fmt.Fprintf(&buf, "const GOARCH = `%s`\n\n", target)
|
||||
for _, goarch := range goarches {
|
||||
|
@ -6,9 +6,9 @@
|
||||
// constants used by the runtime.
|
||||
package sys
|
||||
|
||||
// The next line makes 'go generate' write the zgen_*.go files with
|
||||
// The next line makes 'go generate' write the zgo*.go files with
|
||||
// per-OS and per-arch information, including constants
|
||||
// named goos_$GOOS and goarch_$GOARCH for every
|
||||
// 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.
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build 386
|
||||
|
||||
package sys
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build amd64
|
||||
|
||||
package sys
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build amd64p32
|
||||
|
||||
package sys
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build arm
|
||||
|
||||
package sys
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build arm64
|
||||
|
||||
package sys
|
||||
|
||||
|
28
src/runtime/internal/sys/zgoarch_arm64be.go
Normal file
28
src/runtime/internal/sys/zgoarch_arm64be.go
Normal file
@ -0,0 +1,28 @@
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build arm64be
|
||||
|
||||
package sys
|
||||
|
||||
const GOARCH = `arm64be`
|
||||
|
||||
const Goarch386 = 0
|
||||
const GoarchAmd64 = 0
|
||||
const GoarchAmd64p32 = 0
|
||||
const GoarchArm = 0
|
||||
const GoarchArmbe = 0
|
||||
const GoarchArm64 = 0
|
||||
const GoarchArm64be = 1
|
||||
const GoarchPpc64 = 0
|
||||
const GoarchPpc64le = 0
|
||||
const GoarchMips = 0
|
||||
const GoarchMipsle = 0
|
||||
const GoarchMips64 = 0
|
||||
const GoarchMips64le = 0
|
||||
const GoarchMips64p32 = 0
|
||||
const GoarchMips64p32le = 0
|
||||
const GoarchPpc = 0
|
||||
const GoarchS390 = 0
|
||||
const GoarchS390x = 0
|
||||
const GoarchSparc = 0
|
||||
const GoarchSparc64 = 0
|
28
src/runtime/internal/sys/zgoarch_armbe.go
Normal file
28
src/runtime/internal/sys/zgoarch_armbe.go
Normal file
@ -0,0 +1,28 @@
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build armbe
|
||||
|
||||
package sys
|
||||
|
||||
const GOARCH = `armbe`
|
||||
|
||||
const Goarch386 = 0
|
||||
const GoarchAmd64 = 0
|
||||
const GoarchAmd64p32 = 0
|
||||
const GoarchArm = 0
|
||||
const GoarchArmbe = 1
|
||||
const GoarchArm64 = 0
|
||||
const GoarchArm64be = 0
|
||||
const GoarchPpc64 = 0
|
||||
const GoarchPpc64le = 0
|
||||
const GoarchMips = 0
|
||||
const GoarchMipsle = 0
|
||||
const GoarchMips64 = 0
|
||||
const GoarchMips64le = 0
|
||||
const GoarchMips64p32 = 0
|
||||
const GoarchMips64p32le = 0
|
||||
const GoarchPpc = 0
|
||||
const GoarchS390 = 0
|
||||
const GoarchS390x = 0
|
||||
const GoarchSparc = 0
|
||||
const GoarchSparc64 = 0
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build mips
|
||||
|
||||
package sys
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build mips64
|
||||
|
||||
package sys
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build mips64le
|
||||
|
||||
package sys
|
||||
|
||||
|
28
src/runtime/internal/sys/zgoarch_mips64p32.go
Normal file
28
src/runtime/internal/sys/zgoarch_mips64p32.go
Normal file
@ -0,0 +1,28 @@
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build mips64p32
|
||||
|
||||
package sys
|
||||
|
||||
const GOARCH = `mips64p32`
|
||||
|
||||
const Goarch386 = 0
|
||||
const GoarchAmd64 = 0
|
||||
const GoarchAmd64p32 = 0
|
||||
const GoarchArm = 0
|
||||
const GoarchArmbe = 0
|
||||
const GoarchArm64 = 0
|
||||
const GoarchArm64be = 0
|
||||
const GoarchPpc64 = 0
|
||||
const GoarchPpc64le = 0
|
||||
const GoarchMips = 0
|
||||
const GoarchMipsle = 0
|
||||
const GoarchMips64 = 0
|
||||
const GoarchMips64le = 0
|
||||
const GoarchMips64p32 = 1
|
||||
const GoarchMips64p32le = 0
|
||||
const GoarchPpc = 0
|
||||
const GoarchS390 = 0
|
||||
const GoarchS390x = 0
|
||||
const GoarchSparc = 0
|
||||
const GoarchSparc64 = 0
|
28
src/runtime/internal/sys/zgoarch_mips64p32le.go
Normal file
28
src/runtime/internal/sys/zgoarch_mips64p32le.go
Normal file
@ -0,0 +1,28 @@
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build mips64p32le
|
||||
|
||||
package sys
|
||||
|
||||
const GOARCH = `mips64p32le`
|
||||
|
||||
const Goarch386 = 0
|
||||
const GoarchAmd64 = 0
|
||||
const GoarchAmd64p32 = 0
|
||||
const GoarchArm = 0
|
||||
const GoarchArmbe = 0
|
||||
const GoarchArm64 = 0
|
||||
const GoarchArm64be = 0
|
||||
const GoarchPpc64 = 0
|
||||
const GoarchPpc64le = 0
|
||||
const GoarchMips = 0
|
||||
const GoarchMipsle = 0
|
||||
const GoarchMips64 = 0
|
||||
const GoarchMips64le = 0
|
||||
const GoarchMips64p32 = 0
|
||||
const GoarchMips64p32le = 1
|
||||
const GoarchPpc = 0
|
||||
const GoarchS390 = 0
|
||||
const GoarchS390x = 0
|
||||
const GoarchSparc = 0
|
||||
const GoarchSparc64 = 0
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build mipsle
|
||||
|
||||
package sys
|
||||
|
||||
|
28
src/runtime/internal/sys/zgoarch_ppc.go
Normal file
28
src/runtime/internal/sys/zgoarch_ppc.go
Normal file
@ -0,0 +1,28 @@
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build ppc
|
||||
|
||||
package sys
|
||||
|
||||
const GOARCH = `ppc`
|
||||
|
||||
const Goarch386 = 0
|
||||
const GoarchAmd64 = 0
|
||||
const GoarchAmd64p32 = 0
|
||||
const GoarchArm = 0
|
||||
const GoarchArmbe = 0
|
||||
const GoarchArm64 = 0
|
||||
const GoarchArm64be = 0
|
||||
const GoarchPpc64 = 0
|
||||
const GoarchPpc64le = 0
|
||||
const GoarchMips = 0
|
||||
const GoarchMipsle = 0
|
||||
const GoarchMips64 = 0
|
||||
const GoarchMips64le = 0
|
||||
const GoarchMips64p32 = 0
|
||||
const GoarchMips64p32le = 0
|
||||
const GoarchPpc = 1
|
||||
const GoarchS390 = 0
|
||||
const GoarchS390x = 0
|
||||
const GoarchSparc = 0
|
||||
const GoarchSparc64 = 0
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build ppc64
|
||||
|
||||
package sys
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build ppc64le
|
||||
|
||||
package sys
|
||||
|
||||
|
28
src/runtime/internal/sys/zgoarch_s390.go
Normal file
28
src/runtime/internal/sys/zgoarch_s390.go
Normal file
@ -0,0 +1,28 @@
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build s390
|
||||
|
||||
package sys
|
||||
|
||||
const GOARCH = `s390`
|
||||
|
||||
const Goarch386 = 0
|
||||
const GoarchAmd64 = 0
|
||||
const GoarchAmd64p32 = 0
|
||||
const GoarchArm = 0
|
||||
const GoarchArmbe = 0
|
||||
const GoarchArm64 = 0
|
||||
const GoarchArm64be = 0
|
||||
const GoarchPpc64 = 0
|
||||
const GoarchPpc64le = 0
|
||||
const GoarchMips = 0
|
||||
const GoarchMipsle = 0
|
||||
const GoarchMips64 = 0
|
||||
const GoarchMips64le = 0
|
||||
const GoarchMips64p32 = 0
|
||||
const GoarchMips64p32le = 0
|
||||
const GoarchPpc = 0
|
||||
const GoarchS390 = 1
|
||||
const GoarchS390x = 0
|
||||
const GoarchSparc = 0
|
||||
const GoarchSparc64 = 0
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build s390x
|
||||
|
||||
package sys
|
||||
|
||||
|
28
src/runtime/internal/sys/zgoarch_sparc.go
Normal file
28
src/runtime/internal/sys/zgoarch_sparc.go
Normal file
@ -0,0 +1,28 @@
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build sparc
|
||||
|
||||
package sys
|
||||
|
||||
const GOARCH = `sparc`
|
||||
|
||||
const Goarch386 = 0
|
||||
const GoarchAmd64 = 0
|
||||
const GoarchAmd64p32 = 0
|
||||
const GoarchArm = 0
|
||||
const GoarchArmbe = 0
|
||||
const GoarchArm64 = 0
|
||||
const GoarchArm64be = 0
|
||||
const GoarchPpc64 = 0
|
||||
const GoarchPpc64le = 0
|
||||
const GoarchMips = 0
|
||||
const GoarchMipsle = 0
|
||||
const GoarchMips64 = 0
|
||||
const GoarchMips64le = 0
|
||||
const GoarchMips64p32 = 0
|
||||
const GoarchMips64p32le = 0
|
||||
const GoarchPpc = 0
|
||||
const GoarchS390 = 0
|
||||
const GoarchS390x = 0
|
||||
const GoarchSparc = 1
|
||||
const GoarchSparc64 = 0
|
28
src/runtime/internal/sys/zgoarch_sparc64.go
Normal file
28
src/runtime/internal/sys/zgoarch_sparc64.go
Normal file
@ -0,0 +1,28 @@
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build sparc64
|
||||
|
||||
package sys
|
||||
|
||||
const GOARCH = `sparc64`
|
||||
|
||||
const Goarch386 = 0
|
||||
const GoarchAmd64 = 0
|
||||
const GoarchAmd64p32 = 0
|
||||
const GoarchArm = 0
|
||||
const GoarchArmbe = 0
|
||||
const GoarchArm64 = 0
|
||||
const GoarchArm64be = 0
|
||||
const GoarchPpc64 = 0
|
||||
const GoarchPpc64le = 0
|
||||
const GoarchMips = 0
|
||||
const GoarchMipsle = 0
|
||||
const GoarchMips64 = 0
|
||||
const GoarchMips64le = 0
|
||||
const GoarchMips64p32 = 0
|
||||
const GoarchMips64p32le = 0
|
||||
const GoarchPpc = 0
|
||||
const GoarchS390 = 0
|
||||
const GoarchS390x = 0
|
||||
const GoarchSparc = 0
|
||||
const GoarchSparc64 = 1
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build android
|
||||
|
||||
package sys
|
||||
|
||||
@ -15,3 +17,4 @@ const GoosOpenbsd = 0
|
||||
const GoosPlan9 = 0
|
||||
const GoosSolaris = 0
|
||||
const GoosWindows = 0
|
||||
const GoosZos = 0
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build darwin
|
||||
|
||||
package sys
|
||||
|
||||
@ -15,3 +17,4 @@ const GoosOpenbsd = 0
|
||||
const GoosPlan9 = 0
|
||||
const GoosSolaris = 0
|
||||
const GoosWindows = 0
|
||||
const GoosZos = 0
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build dragonfly
|
||||
|
||||
package sys
|
||||
|
||||
@ -15,3 +17,4 @@ const GoosOpenbsd = 0
|
||||
const GoosPlan9 = 0
|
||||
const GoosSolaris = 0
|
||||
const GoosWindows = 0
|
||||
const GoosZos = 0
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build freebsd
|
||||
|
||||
package sys
|
||||
|
||||
@ -15,3 +17,4 @@ const GoosOpenbsd = 0
|
||||
const GoosPlan9 = 0
|
||||
const GoosSolaris = 0
|
||||
const GoosWindows = 0
|
||||
const GoosZos = 0
|
||||
|
@ -1,6 +1,7 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build !android
|
||||
// +build linux
|
||||
|
||||
package sys
|
||||
|
||||
@ -17,3 +18,4 @@ const GoosOpenbsd = 0
|
||||
const GoosPlan9 = 0
|
||||
const GoosSolaris = 0
|
||||
const GoosWindows = 0
|
||||
const GoosZos = 0
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build nacl
|
||||
|
||||
package sys
|
||||
|
||||
@ -15,3 +17,4 @@ const GoosOpenbsd = 0
|
||||
const GoosPlan9 = 0
|
||||
const GoosSolaris = 0
|
||||
const GoosWindows = 0
|
||||
const GoosZos = 0
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build netbsd
|
||||
|
||||
package sys
|
||||
|
||||
@ -15,3 +17,4 @@ const GoosOpenbsd = 0
|
||||
const GoosPlan9 = 0
|
||||
const GoosSolaris = 0
|
||||
const GoosWindows = 0
|
||||
const GoosZos = 0
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build openbsd
|
||||
|
||||
package sys
|
||||
|
||||
@ -15,3 +17,4 @@ const GoosOpenbsd = 1
|
||||
const GoosPlan9 = 0
|
||||
const GoosSolaris = 0
|
||||
const GoosWindows = 0
|
||||
const GoosZos = 0
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build plan9
|
||||
|
||||
package sys
|
||||
|
||||
@ -15,3 +17,4 @@ const GoosOpenbsd = 0
|
||||
const GoosPlan9 = 1
|
||||
const GoosSolaris = 0
|
||||
const GoosWindows = 0
|
||||
const GoosZos = 0
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build solaris
|
||||
|
||||
package sys
|
||||
|
||||
@ -15,3 +17,4 @@ const GoosOpenbsd = 0
|
||||
const GoosPlan9 = 0
|
||||
const GoosSolaris = 1
|
||||
const GoosWindows = 0
|
||||
const GoosZos = 0
|
||||
|
@ -1,4 +1,6 @@
|
||||
// generated by gengoos.go using 'go generate'
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build windows
|
||||
|
||||
package sys
|
||||
|
||||
@ -15,3 +17,4 @@ const GoosOpenbsd = 0
|
||||
const GoosPlan9 = 0
|
||||
const GoosSolaris = 0
|
||||
const GoosWindows = 1
|
||||
const GoosZos = 0
|
||||
|
20
src/runtime/internal/sys/zgoos_zos.go
Normal file
20
src/runtime/internal/sys/zgoos_zos.go
Normal file
@ -0,0 +1,20 @@
|
||||
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
|
||||
|
||||
// +build zos
|
||||
|
||||
package sys
|
||||
|
||||
const GOOS = `zos`
|
||||
|
||||
const GoosAndroid = 0
|
||||
const GoosDarwin = 0
|
||||
const GoosDragonfly = 0
|
||||
const GoosFreebsd = 0
|
||||
const GoosLinux = 0
|
||||
const GoosNacl = 0
|
||||
const GoosNetbsd = 0
|
||||
const GoosOpenbsd = 0
|
||||
const GoosPlan9 = 0
|
||||
const GoosSolaris = 0
|
||||
const GoosWindows = 0
|
||||
const GoosZos = 1
|
Loading…
Reference in New Issue
Block a user