Skip to content

Commit

Permalink
Apply the same solution on Swift5 and 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Joannis committed Nov 17, 2019
1 parent 6ab8520 commit 3f47055
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
Binary file not shown.
4 changes: 0 additions & 4 deletions Sources/NioDNS/NioDNS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ public final class NioDNS: Resolver {
let scopeID: UInt32 = 0 // More info about scope_id/zone_id https://tools.ietf.org/html/rfc6874#page-3
let flowinfo: UInt32 = 0 // More info about flowinfo https://tools.ietf.org/html/rfc6437#page-4
#if os(Linux)
#if swift(>=5.1)
let sockaddr = sockaddr_in6(sin6_family: sa_family_t(AF_INET6), sin6_port: in_port_t(port), sin6_flowinfo: flowinfo, sin6_addr: ipAddress, sin6_scope_id: scopeID)
#else
let sockaddr = sockaddr_in6(sin6_family: sa_family_t(AF_INET6), sin6_port: in_port_t(port), sin6_flowinfo: flowinfo, sin6_addr: in6_addr(__in6_u: ipAddress), sin6_scope_id: scopeID)
#endif
#else
let size = MemoryLayout<sockaddr_in6>.size
let sockaddr = sockaddr_in6(sin6_len: numericCast(size), sin6_family: sa_family_t(AF_INET6), sin6_port: in_port_t(port), sin6_flowinfo: flowinfo, sin6_addr: in6_addr(__u6_addr: ipAddress), sin6_scope_id: scopeID)
Expand Down

0 comments on commit 3f47055

Please sign in to comment.