From b487d4e42501fa5d1ef8f589a0cd89c187d09fc3 Mon Sep 17 00:00:00 2001 From: Stefan Talpalaru Date: Tue, 16 Jun 2015 15:15:17 +0200 Subject: conditional TGenericSeq extension --- lib/system.nim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/system.nim') diff --git a/lib/system.nim b/lib/system.nim index 5d723bed3..2beb5b88d 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -304,7 +304,9 @@ const ArrayDummySize = when defined(cpu16): 10_000 else: 100_000_000 when not defined(JS): type TGenericSeq {.compilerproc, pure, inheritable.} = object - len, reserved, elemSize: int + len, reserved: int + when defined(gogc): + elemSize: int PGenericSeq {.exportc.} = ptr TGenericSeq UncheckedCharArray {.unchecked.} = array[0..ArrayDummySize, char] # len and space without counting the terminating zero: @@ -2682,8 +2684,10 @@ when not defined(JS): #and not defined(NimrodVM): when not defined(NimrodVM): include "system/sets" - const - GenericSeqSize = (3 * sizeof(int)) + when defined(gogc): + const GenericSeqSize = (3 * sizeof(int)) + else: + const GenericSeqSize = (2 * sizeof(int)) proc getDiscriminant(aa: pointer, n: ptr TNimNode): int = sysAssert(n.kind == nkCase, "getDiscriminant: node != nkCase") -- cgit 1.4.1-2-gfad0