Skip to content

Commit 769e46a

Browse files
committed
more of the same
1 parent eb15e6f commit 769e46a

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

lib/system.nim

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,11 +1620,28 @@ when notJSnotNims:
16201620
import system/ansi_c
16211621
import system/memory
16221622

1623+
when notJSnotNims and defined(nimSeqsV2):
1624+
const nimStrVersion {.core.} = 2
1625+
1626+
type
1627+
NimStrPayloadBase = object
1628+
cap: int
1629+
1630+
NimStrPayload {.core.} = object
1631+
cap: int
1632+
data: UncheckedArray[char]
1633+
1634+
NimStringV2 {.core.} = object
1635+
len: int
1636+
p: ptr NimStrPayload ## can be nil if len == 0.
1637+
16231638
when defined(windows):
16241639
proc GetLastError(): int32 {.header: "<windows.h>", nodecl.}
16251640
const ERROR_BAD_EXE_FORMAT = 193
16261641

16271642
when notJSnotNims:
1643+
proc nimToCStringConv(s: NimStringV2): cstring {.compilerproc, nonReloadable, inline.}
1644+
16281645
when hostOS != "standalone" and hostOS != "any":
16291646
type
16301647
LibHandle = pointer # private type
@@ -1665,21 +1682,6 @@ when not defined(js) and defined(nimV2):
16651682
vTable: UncheckedArray[pointer] # vtable for types
16661683
PNimTypeV2 = ptr TNimTypeV2
16671684

1668-
when notJSnotNims and defined(nimSeqsV2):
1669-
const nimStrVersion {.core.} = 2
1670-
1671-
type
1672-
NimStrPayloadBase = object
1673-
cap: int
1674-
1675-
NimStrPayload {.core.} = object
1676-
cap: int
1677-
data: UncheckedArray[char]
1678-
1679-
NimStringV2 {.core.} = object
1680-
len: int
1681-
p: ptr NimStrPayload ## can be nil if len == 0.
1682-
16831685
when not defined(nimIcIntegrityChecks):
16841686
import system/exceptions
16851687
export exceptions

lib/system/arithmetics.nim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{.push stack_trace: off.}
2+
13
proc succ*[T, V: Ordinal](x: T, y: V = 1): T {.magic: "Succ", noSideEffect.} =
24
## Returns the `y`-th successor (default: 1) of the value `x`.
35
##
@@ -403,3 +405,5 @@ proc `%%`*(x, y: int8): int8 {.inline.} = cast[int8](cast[uint8](x) mod cast[u
403405
proc `%%`*(x, y: int16): int16 {.inline.} = cast[int16](cast[uint16](x) mod cast[uint16](y))
404406
proc `%%`*(x, y: int32): int32 {.inline.} = cast[int32](cast[uint32](x) mod cast[uint32](y))
405407
proc `%%`*(x, y: int64): int64 {.inline.} = cast[int64](cast[uint64](x) mod cast[uint64](y))
408+
409+
{.pop.}

lib/system/dyncalls.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# However, the interface has been designed to take platform differences into
1313
# account and been ported to all major platforms.
1414

15-
{.push stack_trace: off.}
15+
{.push stack_trace: off, checks: off.}
1616

1717
const
1818
NilLibHandle: LibHandle = nil

0 commit comments

Comments
 (0)