mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 11:42:33 +00:00
fixes #1964
This commit is contained in:
@@ -292,11 +292,12 @@ const NoFakeVars* = defined(NimrodVM) ## true if the backend doesn't support \
|
||||
## "fake variables" like 'var EBADF {.importc.}: cint'.
|
||||
|
||||
when not defined(JS):
|
||||
const ArrayDummySize = when defined(cpu16): 10_000 else: 100_000_000
|
||||
type
|
||||
TGenericSeq {.compilerproc, pure, inheritable.} = object
|
||||
len, reserved: int
|
||||
PGenericSeq {.exportc.} = ptr TGenericSeq
|
||||
UncheckedCharArray {.unchecked.} = array[0..100_000_000, char]
|
||||
UncheckedCharArray {.unchecked.} = array[0..ArrayDummySize, char]
|
||||
# len and space without counting the terminating zero:
|
||||
NimStringDesc {.compilerproc, final.} = object of TGenericSeq
|
||||
data: UncheckedCharArray
|
||||
@@ -1227,7 +1228,7 @@ type # these work for most platforms:
|
||||
culonglong* {.importc: "unsigned long long", nodecl.} = uint64
|
||||
## This is the same as the type ``unsigned long long`` in *C*.
|
||||
|
||||
cstringArray* {.importc: "char**", nodecl.} = ptr array [0..50_000, cstring]
|
||||
cstringArray* {.importc: "char**", nodecl.} = ptr array [0..ArrayDummySize, cstring]
|
||||
## This is binary compatible to the type ``char**`` in *C*. The array's
|
||||
## high value is large enough to disable bounds checking in practice.
|
||||
## Use `cstringArrayToSeq` to convert it into a ``seq[string]``.
|
||||
|
||||
Reference in New Issue
Block a user