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