mirror of
https://github.com/golang/go
synced 2024-11-26 12:09:04 -07:00
net: adjust build tags for darwin libc calls
Support for direct libc calls was added in CL 446178 but the build tags weren't quite activating it when cgo was not enabled. Adjust them and add a new supporting file for darwin. This should use the new direct libc calls with both CGO_ENABLED=0 and CGO_ENABLED=1 when building for darwin. Updates #12524 Change-Id: Ieee4b298dee13f389ed3a63c0a4a3a18c9180163 Reviewed-on: https://go-review.googlesource.com/c/go/+/448020 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Dan Peterson <danp@danp.net> Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
969bea8d59
commit
e7422b0591
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build cgo && !netgo && (darwin || dragonfly || freebsd)
|
//go:build cgo && !netgo && (dragonfly || freebsd)
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
||||||
|
9
src/net/cgo_darwin.go
Normal file
9
src/net/cgo_darwin.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// Copyright 2022 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 net
|
||||||
|
|
||||||
|
import "internal/syscall/unix"
|
||||||
|
|
||||||
|
const cgoAddrInfoFlags = (unix.AI_CANONNAME | unix.AI_V4MAPPED | unix.AI_ALL) & unix.AI_MASK
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build !cgo || netgo
|
//go:build (!cgo && !darwin) || netgo
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
// Instead of C.foo it uses _C_foo, which is defined in either
|
// Instead of C.foo it uses _C_foo, which is defined in either
|
||||||
// cgo_unix_cgo.go or cgo_unix_syscall.go
|
// cgo_unix_cgo.go or cgo_unix_syscall.go
|
||||||
|
|
||||||
//go:build cgo && !netgo && unix
|
//go:build !netgo && ((cgo && unix) || darwin)
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build cgo && !netgo && darwin
|
//go:build !netgo && darwin
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build cgo && !netgo && unix
|
//go:build (cgo || darwin) && !netgo && unix
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
// Default netGo to true if the netgo build tag is being used, or the
|
// Default netGo to true if the netgo build tag is being used, or the
|
||||||
// C library DNS routines are not available. Note that the C library
|
// C library DNS routines are not available. Note that the C library
|
||||||
// routines are always available on Windows.
|
// routines are always available on Darwin and Windows.
|
||||||
|
|
||||||
//go:build netgo || (!cgo && !windows)
|
//go:build netgo || (!cgo && !darwin && !windows)
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (!cgo || netgo) && (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris)
|
//go:build (!cgo || netgo) && (dragonfly || freebsd || linux || netbsd || openbsd || solaris)
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user