mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-11-17 15:19:32 +00:00
Build: Build list optimization; build tags clean-up (#5824)
https://github.com/XTLS/Xray-core/pull/5824#issuecomment-6796919801
This commit is contained in:
parent
f082058590
commit
c456141815
@@ -1,5 +1,4 @@
|
||||
//go:build !windows && !wasm && !illumos && !openbsd
|
||||
// +build !windows,!wasm,!illumos,!openbsd
|
||||
//go:build !windows && !openbsd
|
||||
|
||||
package buf
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build !wasm && !openbsd
|
||||
// +build !wasm,!openbsd
|
||||
//go:build !openbsd
|
||||
|
||||
package buf
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build wasm || openbsd
|
||||
// +build wasm openbsd
|
||||
//go:build openbsd
|
||||
|
||||
package buf
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build !wasm && !openbsd
|
||||
// +build !wasm,!openbsd
|
||||
//go:build !openbsd
|
||||
|
||||
package buf_test
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
//go:build illumos
|
||||
// +build illumos
|
||||
|
||||
package buf
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
type unixReader struct {
|
||||
iovs [][]byte
|
||||
}
|
||||
|
||||
func (r *unixReader) Init(bs []*Buffer) {
|
||||
iovs := r.iovs
|
||||
if iovs == nil {
|
||||
iovs = make([][]byte, 0, len(bs))
|
||||
}
|
||||
for _, b := range bs {
|
||||
iovs = append(iovs, b.v)
|
||||
}
|
||||
r.iovs = iovs
|
||||
}
|
||||
|
||||
func (r *unixReader) Read(fd uintptr) int32 {
|
||||
n, e := unix.Readv(int(fd), r.iovs)
|
||||
if e != nil {
|
||||
return -1
|
||||
}
|
||||
return int32(n)
|
||||
}
|
||||
|
||||
func (r *unixReader) Clear() {
|
||||
r.iovs = r.iovs[:0]
|
||||
}
|
||||
|
||||
func newMultiReader() multiReader {
|
||||
return &unixReader{}
|
||||
}
|
||||
Reference in New Issue
Block a user