mirror of
https://github.com/fosrl/olm.git
synced 2026-10-20 11:39:08 +02:00
Add ios stub
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
//go:build ios
|
||||||
|
|
||||||
|
package dns
|
||||||
|
|
||||||
|
// readSystemDNS returns nil on iOS: olm cannot read the OS's DNS
|
||||||
|
// configuration itself here, so the app must detect it and push it in
|
||||||
|
// through the equivalent of Olm.SetSystemDNS instead.
|
||||||
|
//
|
||||||
|
// This is a dedicated file (rather than falling through the general
|
||||||
|
// sysresolver_stub.go catch-all) because Go's build constraint evaluator
|
||||||
|
// treats GOOS=ios as implicitly satisfying the "darwin" tag as well as
|
||||||
|
// "ios". sysresolver_stub.go excludes with "!darwin", which is false for an
|
||||||
|
// iOS build, so the stub silently stops applying and would leave
|
||||||
|
// readSystemDNS undefined. An explicit "ios" constraint isn't affected by
|
||||||
|
// that ambiguity.
|
||||||
|
func readSystemDNS() []string {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
+14
-9
@@ -3,16 +3,21 @@
|
|||||||
package dns
|
package dns
|
||||||
|
|
||||||
// readSystemDNS returns nil on platforms where automatic DNS discovery is not
|
// readSystemDNS returns nil on platforms where automatic DNS discovery is not
|
||||||
// implemented (ios, freebsd, etc.). Callers should fall back to a
|
// implemented (freebsd, etc.). Callers should fall back to a statically
|
||||||
// statically configured DNS server.
|
// configured DNS server.
|
||||||
//
|
//
|
||||||
// android is excluded from this constraint (and has its own sysresolver_android.go
|
// android and ios are excluded from this constraint (and have their own
|
||||||
// with an explicit "android" tag) rather than falling through the "!linux" catch-all
|
// sysresolver_android.go / sysresolver_ios.go with an explicit "android" /
|
||||||
// here: wireguard-android's build passes "-tags linux" to share Linux netlink code
|
// "ios" tag) rather than falling through the "!linux" / "!darwin" catch-all
|
||||||
// (a deliberate, long-standing convention, since Android's kernel is Linux), and Go's
|
// here:
|
||||||
// build constraint evaluator can't distinguish a custom "-tags linux" from the real
|
// - wireguard-android's build passes "-tags linux" to share Linux netlink code
|
||||||
// GOOS=linux - so with that tag set, "!linux" is false even though GOOS is actually
|
// (a deliberate, long-standing convention, since Android's kernel is Linux), and Go's
|
||||||
// android, and this file would silently stop applying, leaving readSystemDNS undefined.
|
// build constraint evaluator can't distinguish a custom "-tags linux" from the real
|
||||||
|
// GOOS=linux - so with that tag set, "!linux" is false even though GOOS is actually
|
||||||
|
// android, and this file would silently stop applying, leaving readSystemDNS undefined.
|
||||||
|
// - Go's build constraint evaluator treats GOOS=ios as implicitly satisfying the
|
||||||
|
// "darwin" tag as well as "ios", so "!darwin" is false on an iOS build too, which
|
||||||
|
// would otherwise leave readSystemDNS undefined there as well.
|
||||||
func readSystemDNS() []string {
|
func readSystemDNS() []string {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user