make asyncdispatch compile with the foreign GCs

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

View File

@@ -571,3 +571,11 @@ when not declared(nimNewSeqOfCap):
cast[PGenericSeq](result).reserved = cap
{.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