From d27c0b219249b2584fc7a3f175adfde862ca701f Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 1 Dec 2017 11:20:50 +0100 Subject: [PATCH] make asyncdispatch compile with the foreign GCs --- lib/system/mmdisp.nim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim index 9af36c7b8c..d65d8a10ed 100644 --- a/lib/system/mmdisp.nim +++ b/lib/system/mmdisp.nim @@ -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