]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.cc] runtime: explicitly exclude android in zgoos_linux.go
authorShenghou Ma <minux@golang.org>
Fri, 21 Nov 2014 23:13:59 +0000 (18:13 -0500)
committerShenghou Ma <minux@golang.org>
Fri, 21 Nov 2014 23:13:59 +0000 (18:13 -0500)
Otherwise both zgoos_linux.go and zgoos_android.go will be compiled
for GOOS=android.

LGTM=crawshaw, rsc
R=rsc, crawshaw
CC=golang-codereviews
https://golang.org/cl/178110043

12 files changed:
src/runtime/gengoos.go
src/runtime/zgoos_android.go
src/runtime/zgoos_darwin.go
src/runtime/zgoos_dragonfly.go
src/runtime/zgoos_freebsd.go
src/runtime/zgoos_linux.go
src/runtime/zgoos_nacl.go
src/runtime/zgoos_netbsd.go
src/runtime/zgoos_openbsd.go
src/runtime/zgoos_plan9.go
src/runtime/zgoos_solaris.go
src/runtime/zgoos_windows.go

index 029575bee22139c339d5596a6366c5932bd57fc2..06621c8dba2e320ec096cb808de38c7b2c9cef4e 100644 (file)
@@ -46,7 +46,9 @@ 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, "// +build %s\n\n", target) // usually redundant, but not always; see linux vs android
+               if target == "linux" {
+                       fmt.Fprintf(&buf, "// +build !android\n\n") // must explicitly exclude android for linux
+               }
                fmt.Fprintf(&buf, "package runtime\n\n")
                fmt.Fprintf(&buf, "const theGoos = `%s`\n\n", target)
                for _, goos := range gooses {
index abfba808ba56ada128737cea92b10fa876fd3d68..0590bd9ab7dc488b3fdf89906316f5640e0c80fb 100644 (file)
@@ -1,7 +1,5 @@
 // generated by gengoos.go using 'go generate'
 
-// +build android
-
 package runtime
 
 const theGoos = `android`
index eb39b53dd462bb150ad8db2485b3593e6da27eac..c0a7cd6e7472eb62bffd746d8c2de0b9ddf8f834 100644 (file)
@@ -1,7 +1,5 @@
 // generated by gengoos.go using 'go generate'
 
-// +build darwin
-
 package runtime
 
 const theGoos = `darwin`
index f6e839d3d833c014482e43e8709308fe7bbe3072..008d6de81181ed0b3480e85f8d85240d80e85ccb 100644 (file)
@@ -1,7 +1,5 @@
 // generated by gengoos.go using 'go generate'
 
-// +build dragonfly
-
 package runtime
 
 const theGoos = `dragonfly`
index 3c47aef2ab4ec75e47cfd25f8fc07d6347004052..2478940353eb887e61638a37b39c81ff3d22955a 100644 (file)
@@ -1,7 +1,5 @@
 // generated by gengoos.go using 'go generate'
 
-// +build freebsd
-
 package runtime
 
 const theGoos = `freebsd`
index 5d899e3db6ce527db95a96a11849bd633486467e..c775ab538d4e086afcbb10083e7c213d12dcc4f8 100644 (file)
@@ -1,6 +1,6 @@
 // generated by gengoos.go using 'go generate'
 
-// +build linux
+// +build !android
 
 package runtime
 
index b5c4281fb56176c8368cb6f4f997a29310b7fe72..d9d88f4508a969fcff0a636f745c88b9e807c89b 100644 (file)
@@ -1,7 +1,5 @@
 // generated by gengoos.go using 'go generate'
 
-// +build nacl
-
 package runtime
 
 const theGoos = `nacl`
index b2e45222ae3be049a8ee30e368e1ecbdd64f666a..ff2c5cb8f4a95b0c37a62bb70b8a8164ed4a764a 100644 (file)
@@ -1,7 +1,5 @@
 // generated by gengoos.go using 'go generate'
 
-// +build netbsd
-
 package runtime
 
 const theGoos = `netbsd`
index 331c96dd6622fc992ea03f477a02bd8486cd1bf7..b071dc63ab75a409fcd7adcc7d57f214c9af19a7 100644 (file)
@@ -1,7 +1,5 @@
 // generated by gengoos.go using 'go generate'
 
-// +build openbsd
-
 package runtime
 
 const theGoos = `openbsd`
index f29eb452304706c1a6027b801507260b6f86b971..4306b0f1ef41569698ca517d7ae057f8bd7f2c13 100644 (file)
@@ -1,7 +1,5 @@
 // generated by gengoos.go using 'go generate'
 
-// +build plan9
-
 package runtime
 
 const theGoos = `plan9`
index ac613db33c4508744a3681d57de6e2f28bdacf57..10f9537d05ba892fcec3e0351f836fb3f5f1e056 100644 (file)
@@ -1,7 +1,5 @@
 // generated by gengoos.go using 'go generate'
 
-// +build solaris
-
 package runtime
 
 const theGoos = `solaris`
index 43710d862feabeb8d80259800420598dfb9ba66c..56f5c58ce64385307334fa62f33f15d5468c8459 100644 (file)
@@ -1,7 +1,5 @@
 // generated by gengoos.go using 'go generate'
 
-// +build windows
-
 package runtime
 
 const theGoos = `windows`