Browse Source

Fix ios build

Cannot use errno as method and variable due to conflict with objc
世界 2 years ago
parent
commit
b2092fafb7
2 changed files with 6 additions and 10 deletions
  1. 6 2
      experimental/libbox/dns.go
  2. 0 8
      experimental/libbox/setup.go

+ 6 - 2
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)
 }

+ 0 - 8
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
-}