make asyncdispatch compile with the foreign GCs

This commit is contained in:
Araq 2017-12-01 11:20:50 +01:00
commit d27c0b2192

View file

@ -571,3 +571,11 @@ when not declared(nimNewSeqOfCap):
cast[PGenericSeq](result).reserved = cap cast[PGenericSeq](result).reserved = cap
{.pop.} {.pop.}
when not declared(ForeignCell):
type ForeignCell* = object
data*: pointer
proc protect*(x: pointer): ForeignCell = ForeignCell(data: x)
proc dispose*(x: ForeignCell) = discard
proc isNotForeign*(x: ForeignCell): bool = false