// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build cgo && !netgo && (darwin || dragonfly || freebsd)
+//go:build cgo && !netgo && (dragonfly || freebsd)
package net
--- /dev/null
+// 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
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !cgo || netgo
+//go:build (!cgo && !darwin) || netgo
package net
// Instead of C.foo it uses _C_foo, which is defined in either
// cgo_unix_cgo.go or cgo_unix_syscall.go
-//go:build cgo && !netgo && unix
+//go:build !netgo && ((cgo && unix) || darwin)
package net
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build cgo && !netgo && darwin
+//go:build !netgo && darwin
package net
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build cgo && !netgo && unix
+//go:build (cgo || darwin) && !netgo && unix
package net
// 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
-// 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
// Use of this source code is governed by a BSD-style
// 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