Skip to content

Commit 9790927

Browse files
committed
build: add NetBSD and OpenBSD supports
1 parent a147af2 commit 9790927

38 files changed

+76
-72
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<br />
44
<a title="Build Status" target="_blank" href="https://github.com/panjf2000/gnet/actions?query=workflow%3ATests"><img src="https://img.shields.io/github/actions/workflow/status/panjf2000/gnet/test.yml?branch=dev&style=flat-square&logo=github-actions" /></a>
55
<a title="Codecov" target="_blank" href="https://codecov.io/gh/panjf2000/gnet"><img src="https://img.shields.io/codecov/c/github/panjf2000/gnet?style=flat-square&logo=codecov" /></a>
6-
<a title="Supported Platforms" target="_blank" href="https://github.com/panjf2000/gnet"><img src="https://img.shields.io/badge/platform-Linux%20%7C%20FreeBSD%20%7C%20DragonFly%20%7C%20Darwin%20%7C%20Windows-549688?style=flat-square&logo=launchpad" /></a>
6+
<a title="Supported Platforms" target="_blank" href="https://github.com/panjf2000/gnet"><img src="https://img.shields.io/badge/platform-Linux%20%7C%20FreeBSD%20%7C%20DragonFly%20%7C%20NetBSD%20%7C%20OpenBSD%20%7C%20Darwin%20%7C%20Windows-549688?style=flat-square&logo=launchpad" /></a>
77
<a title="Require Go Version" target="_blank" href="https://github.com/panjf2000/gnet"><img src="https://img.shields.io/badge/go-%3E%3D1.17-30dff3?style=flat-square&logo=go" /></a>
88
<br />
99
<a title="Chat Room" target="_blank" href="https://gitter.im/gnet-io/gnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/gnet-io/gnet.svg" /></a>

README_ZH.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<br />
44
<a title="Build Status" target="_blank" href="https://github.com/panjf2000/gnet/actions?query=workflow%3ATests"><img src="https://img.shields.io/github/actions/workflow/status/panjf2000/gnet/test.yml?branch=dev&style=flat-square&logo=github-actions" /></a>
55
<a title="Codecov" target="_blank" href="https://codecov.io/gh/panjf2000/gnet"><img src="https://img.shields.io/codecov/c/github/panjf2000/gnet?style=flat-square&logo=codecov" /></a>
6-
<a title="Supported Platforms" target="_blank" href="https://github.com/panjf2000/gnet"><img src="https://img.shields.io/badge/platform-Linux%20%7C%20FreeBSD%20%7C%20DragonFly%20%7C%20Darwin%20%7C%20Windows-549688?style=flat-square&logo=launchpad" /></a>
6+
<a title="Supported Platforms" target="_blank" href="https://github.com/panjf2000/gnet"><img src="https://img.shields.io/badge/platform-Linux%20%7C%20FreeBSD%20%7C%20DragonFly%20%7C%20NetBSD%20%7C%20OpenBSD%20%7C%20Darwin%20%7C%20Windows-549688?style=flat-square&logo=launchpad" /></a>
77
<a title="Require Go Version" target="_blank" href="https://github.com/panjf2000/gnet"><img src="https://img.shields.io/badge/go-%3E%3D1.17-30dff3?style=flat-square&logo=go" /></a>
88
<br />
99
<a title="Chat Room" target="_blank" href="https://gitter.im/gnet-io/gnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/gnet-io/gnet.svg" /></a>

acceptor_bsd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build freebsd || dragonfly || darwin
16-
// +build freebsd dragonfly darwin
15+
//go:build freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build freebsd dragonfly netbsd openbsd darwin
1717

1818
package gnet
1919

acceptor_unix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package gnet
1919

client_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build linux || freebsd || dragonfly || darwin || windows
2-
// +build linux freebsd dragonfly darwin windows
1+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin || windows
2+
// +build linux freebsd dragonfly netbsd openbsd darwin windows
33

44
package gnet
55

client_unix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package gnet
1919

conn_map.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build (linux || freebsd || dragonfly || darwin) && !gc_opt
16-
// +build linux freebsd dragonfly darwin
15+
//go:build (linux || freebsd || dragonfly || netbsd || openbsd || darwin) && !gc_opt
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717
// +build !gc_opt
1818

1919
package gnet

conn_matrix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build (linux || freebsd || dragonfly || darwin) && gc_opt
16-
// +build linux freebsd dragonfly darwin
15+
//go:build (linux || freebsd || dragonfly || netbsd || openbsd || darwin) && gc_opt
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717
// +build gc_opt
1818

1919
package gnet

conn_matrix_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build (linux || freebsd || dragonfly || darwin) && gc_opt
2-
// +build linux freebsd dragonfly darwin
1+
//go:build (linux || freebsd || dragonfly || netbsd || openbsd || darwin) && gc_opt
2+
// +build linux freebsd dragonfly netbsd openbsd darwin
33
// +build gc_opt
44

55
package gnet

connection_bsd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build freebsd || dragonfly || darwin
16-
// +build freebsd dragonfly darwin
15+
//go:build freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build freebsd dragonfly netbsd openbsd darwin
1717

1818
package gnet
1919

connection_unix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package gnet
1919

engine_unix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package gnet
1919

eventloop_unix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package gnet
1919

eventloop_unix_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build linux || freebsd || dragonfly || darwin
2-
// +build linux freebsd dragonfly darwin
1+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
2+
// +build linux freebsd dragonfly netbsd openbsd darwin
33

44
package gnet
55

internal/io/io_bsd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build freebsd || dragonfly || darwin
16-
// +build freebsd dragonfly darwin
15+
//go:build freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build freebsd dragonfly netbsd openbsd darwin
1717

1818
package io
1919

internal/netpoll/defs_bsd_32bit.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build (freebsd || dragonfly || darwin) && (386 || arm || mips || mipsle)
15+
//go:build (freebsd || dragonfly || netbsd || openbsd || darwin) && (386 || arm || mips || mipsle)
16+
// +build freebsd dragonfly netbsd openbsd darwin
17+
// +build 386 arm mips mipsle
1618

1719
package netpoll
1820

internal/netpoll/defs_bsd_64bit.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build (freebsd || dragonfly || darwin) && (amd64 || arm64 || ppc64 || ppc64le || mips64 || mips64le || riscv64)
15+
//go:build (freebsd || dragonfly || netbsd || openbsd || darwin) && (amd64 || arm64 || ppc64 || ppc64le || mips64 || mips64le || riscv64)
16+
// +build freebsd dragonfly netbsd openbsd darwin
17+
// +build amd64 arm64 ppc64 ppc64le mips64 mips64le riscv64
1618

1719
package netpoll
1820

internal/netpoll/fd_unix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package netpoll
1919

internal/netpoll/kqueue_default_poller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build (freebsd || dragonfly || darwin) && !poll_opt
16-
// +build freebsd dragonfly darwin
15+
//go:build (freebsd || dragonfly || netbsd || openbsd || darwin) && !poll_opt
16+
// +build freebsd dragonfly netbsd openbsd darwin
1717
// +build !poll_opt
1818

1919
package netpoll

internal/netpoll/kqueue_events.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build freebsd || dragonfly || darwin
16-
// +build freebsd dragonfly darwin
15+
//go:build freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build freebsd dragonfly netbsd openbsd darwin
1717

1818
package netpoll
1919

internal/netpoll/kqueue_optimized_poller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build (freebsd || dragonfly || darwin) && poll_opt
16-
// +build freebsd dragonfly darwin
15+
//go:build (freebsd || dragonfly || netbsd || openbsd || darwin) && poll_opt
16+
// +build freebsd dragonfly netbsd openbsd darwin
1717
// +build poll_opt
1818

1919
package netpoll

internal/netpoll/poll_data_bsd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build freebsd || dragonfly || darwin
16-
// +build freebsd dragonfly darwin
15+
//go:build freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build freebsd dragonfly netbsd openbsd darwin
1717

1818
package netpoll
1919

internal/netpoll/poll_data_unix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package netpoll
1919

internal/socket/sock_bsd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
//go:build freebsd || dragonfly || darwin
17-
// +build freebsd dragonfly darwin
16+
//go:build freebsd || dragonfly || netbsd || openbsd || darwin
17+
// +build freebsd dragonfly netbsd openbsd darwin
1818

1919
package socket
2020

internal/socket/sock_cloexec.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly
16-
// +build linux freebsd dragonfly
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd
16+
// +build linux freebsd dragonfly netbsd openbsd
1717

1818
package socket
1919

internal/socket/sock_posix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
//go:build linux || freebsd || dragonfly || darwin
17-
// +build linux freebsd dragonfly darwin
16+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
17+
// +build linux freebsd dragonfly netbsd openbsd darwin
1818

1919
package socket
2020

internal/socket/socket.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
//go:build linux || freebsd || dragonfly || darwin
17-
// +build linux freebsd dragonfly darwin
16+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
17+
// +build linux freebsd dragonfly netbsd openbsd darwin
1818

1919
// Package socket provides functions that return fd and net.Addr based on
2020
// given the protocol and address with a SO_REUSEPORT option set to the socket.

internal/socket/sockopts_posix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package socket
1919

internal/socket/sockopts_unix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly
16-
// +build linux freebsd dragonfly
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd
16+
// +build linux freebsd dragonfly netbsd openbsd
1717

1818
package socket
1919

internal/socket/socktoaddr.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package socket
1919

internal/socket/tcp_socket.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
//go:build linux || freebsd || dragonfly || darwin
17-
// +build linux freebsd dragonfly darwin
16+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
17+
// +build linux freebsd dragonfly netbsd openbsd darwin
1818

1919
package socket
2020

internal/socket/udp_socket.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
//go:build linux || freebsd || dragonfly || darwin
17-
// +build linux freebsd dragonfly darwin
16+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
17+
// +build linux freebsd dragonfly netbsd openbsd darwin
1818

1919
package socket
2020

internal/socket/unix_socket.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package socket
1919

listener_unix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package gnet
1919

os_unix_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build linux || freebsd || dragonfly || darwin
2-
// +build linux freebsd dragonfly darwin
1+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
2+
// +build linux freebsd dragonfly netbsd openbsd darwin
33

44
package gnet
55

pkg/buffer/ring/ring_buffer_unix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build linux || freebsd || dragonfly || darwin
16-
// +build linux freebsd dragonfly darwin
15+
//go:build linux || freebsd || dragonfly || netbsd || openbsd || darwin
16+
// +build linux freebsd dragonfly netbsd openbsd darwin
1717

1818
package ring
1919

reactor_default_bsd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build (freebsd || dragonfly || darwin) && !poll_opt
16-
// +build freebsd dragonfly darwin
15+
//go:build (freebsd || dragonfly || netbsd || openbsd || darwin) && !poll_opt
16+
// +build freebsd dragonfly netbsd openbsd darwin
1717
// +build !poll_opt
1818

1919
package gnet

0 commit comments

Comments
 (0)