mirror of
https://github.com/golang/go
synced 2024-09-23 11:10:12 -06:00
net: only build cgo_stub.go on unix or wasip1
We were building it for Windows, although Windows code never calls any of these functions. When using -tags netgo that cause a multiple definition of cgoAvailable. Fixes #61153 Change-Id: Ib9e1de7720a8c0dacd6f12002917bf305dfa5405 Reviewed-on: https://go-review.googlesource.com/c/go/+/507655 Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
parent
6305d7fdd3
commit
449ef3795d
@ -3,13 +3,13 @@
|
|||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// This file holds stub versions of the cgo functions called on Unix systems.
|
// This file holds stub versions of the cgo functions called on Unix systems.
|
||||||
// We build this file if using the netgo build tag, or if cgo is not
|
// We build this file:
|
||||||
// enabled and we are using a Unix system other than Darwin, or if it's
|
// - if using the netgo build tag on a Unix system
|
||||||
// wasip1 where cgo is never available.
|
// - on a Unix system without the cgo resolver functions
|
||||||
// Darwin is exempted because it always provides the cgo routines,
|
// (Darwin always provides the cgo functions, in cgo_unix_syscall.go)
|
||||||
// in cgo_unix_syscall.go.
|
// - on wasip1, where cgo is never available
|
||||||
|
|
||||||
//go:build netgo || (!cgo && unix && !darwin) || wasip1
|
//go:build (netgo && unix) || (unix && !cgo && !darwin) || wasip1
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user