Skip to content

Commit

Permalink
Merge pull request #18 from timotheecour/pr_fix_compilation
Browse files Browse the repository at this point in the history
fixes #14; fix compilation issues for latest nim release
  • Loading branch information
cheatfate committed Jun 3, 2019
2 parents b365f94 + a314fb8 commit c478bb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions asynctools.nimble
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Package
version = "0.1.0"
version = "0.1.1"
author = "Eugene Kabanov"
description = "Various asynchronous tools for Nim"
license = "MIT"
# Deps
requires "nim >= 0.14.2"
requires "nim >= 0.19.4"
8 changes: 3 additions & 5 deletions asynctools/asyncdns.nim
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const
PACKETSZ = 512

type
uncheckedArray {.unchecked.} [T] = array[0..100_000, T]
uncheckedArray [T] = UncheckedArray[T]
AsyncAddrInfo* = distinct AddrInfo

when defined(windows):
Expand Down Expand Up @@ -658,7 +658,7 @@ else:
psin_len[] = cast[uint8](sizeof(Sockaddr_in))

var addrp = cast[ptr Sockaddr_in](addr sockArr[ai])
addrp.sin_family = toInt(domain)
addrp.sin_family = TSa_Family(toInt(domain))
addrp.sin_port = nativesockets.ntohs(cast[uint16](port))
copyMem(addr addrp.sin_addr, record.rdata, 4)
if k + 1 < count:
Expand All @@ -678,7 +678,7 @@ else:
psin_len[] = cast[uint8](sizeof(Sockaddr_in6))

var addrp = cast[ptr Sockaddr_in6](addr sockArr[ai])
addrp.sin6_family = toInt(domain)
addrp.sin6_family = TSa_Family(toInt(domain))
addrp.sin6_port = nativesockets.ntohs(cast[uint16](port))
copyMem(addr addrp.sin6_addr, record.rdata, 4 * 4)
if k + 1 < count:
Expand Down Expand Up @@ -721,8 +721,6 @@ else:
raise newException(ValueError, "No address records for domain!")
of rtypeError:
raise newException(ValueError, "Wrong record type in response!")
else:
raise newException(ValueError, "Unknown error!")

proc free*(aip: ptr AsyncAddrInfo) =
dealloc(cast[pointer](aip))
Expand Down

0 comments on commit c478bb7

Please sign in to comment.