@@ -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+
16231638when defined (windows):
16241639 proc GetLastError (): int32 {.header : " <windows.h>" , nodecl .}
16251640 const ERROR_BAD_EXE_FORMAT = 193
16261641
16271642when 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-
16831685when not defined (nimIcIntegrityChecks):
16841686 import system/ exceptions
16851687 export exceptions
0 commit comments