From b2092fafb7f934f4e2f8b47c83aa366779c6f6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 19 Jun 2023 14:11:26 +0800 Subject: [PATCH] Fix ios build Cannot use errno as method and variable due to conflict with objc --- experimental/libbox/dns.go | 8 ++++++-- experimental/libbox/setup.go | 8 -------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/experimental/libbox/dns.go b/experimental/libbox/dns.go index bfb8dc53..7e100f9a 100644 --- a/experimental/libbox/dns.go +++ b/experimental/libbox/dns.go @@ -120,6 +120,10 @@ func (p *platformLocalDNSTransport) Lookup(ctx context.Context, domain string, s }) } +type Func interface { + Invoke() error +} + type ExchangeContext struct { context context.Context message mDNS.Msg @@ -153,6 +157,6 @@ func (c *ExchangeContext) ErrorCode(code int32) { c.error = dns.RCodeError(code) } -func (c *ExchangeContext) Errno(errno int32) { - c.error = syscall.Errno(errno) +func (c *ExchangeContext) ErrnoCode(code int32) { + c.error = syscall.Errno(code) } diff --git a/experimental/libbox/setup.go b/experimental/libbox/setup.go index 4afcecf2..e9caf773 100644 --- a/experimental/libbox/setup.go +++ b/experimental/libbox/setup.go @@ -35,11 +35,3 @@ func Version() string { func FormatBytes(length int64) string { return humanize.IBytes(uint64(length)) } - -type Func interface { - Invoke() error -} - -type BoolFunc interface { - Invoke() bool -}