mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 14:55:24 +00:00
IC: progress (#25314)
This commit is contained in:
@@ -1620,6 +1620,41 @@ when notJSnotNims:
|
||||
import system/ansi_c
|
||||
import system/memory
|
||||
|
||||
when notJSnotNims and defined(nimSeqsV2):
|
||||
const nimStrVersion {.core.} = 2
|
||||
|
||||
type
|
||||
NimStrPayloadBase = object
|
||||
cap: int
|
||||
|
||||
NimStrPayload {.core.} = object
|
||||
cap: int
|
||||
data: UncheckedArray[char]
|
||||
|
||||
NimStringV2 {.core.} = object
|
||||
len: int
|
||||
p: ptr NimStrPayload ## can be nil if len == 0.
|
||||
|
||||
when defined(windows):
|
||||
proc GetLastError(): int32 {.header: "<windows.h>", nodecl.}
|
||||
const ERROR_BAD_EXE_FORMAT = 193
|
||||
|
||||
when notJSnotNims:
|
||||
when defined(nimSeqsV2):
|
||||
proc nimToCStringConv(s: NimStringV2): cstring {.compilerproc, nonReloadable, inline.}
|
||||
|
||||
when hostOS != "standalone" and hostOS != "any":
|
||||
type
|
||||
LibHandle = pointer # private type
|
||||
ProcAddr = pointer # library loading and loading of procs:
|
||||
|
||||
proc nimLoadLibrary(path: string): LibHandle {.compilerproc, hcrInline, nonReloadable.}
|
||||
proc nimUnloadLibrary(lib: LibHandle) {.compilerproc, hcrInline, nonReloadable.}
|
||||
proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr {.compilerproc, hcrInline, nonReloadable.}
|
||||
|
||||
proc nimLoadLibraryError(path: string) {.compilerproc, hcrInline, nonReloadable.}
|
||||
|
||||
include "system/dyncalls"
|
||||
|
||||
{.push stackTrace: off.}
|
||||
|
||||
@@ -1648,21 +1683,6 @@ when not defined(js) and defined(nimV2):
|
||||
vTable: UncheckedArray[pointer] # vtable for types
|
||||
PNimTypeV2 = ptr TNimTypeV2
|
||||
|
||||
when notJSnotNims and defined(nimSeqsV2):
|
||||
const nimStrVersion {.core.} = 2
|
||||
|
||||
type
|
||||
NimStrPayloadBase = object
|
||||
cap: int
|
||||
|
||||
NimStrPayload {.core.} = object
|
||||
cap: int
|
||||
data: UncheckedArray[char]
|
||||
|
||||
NimStringV2 {.core.} = object
|
||||
len: int
|
||||
p: ptr NimStrPayload ## can be nil if len == 0.
|
||||
|
||||
when not defined(nimIcIntegrityChecks):
|
||||
import system/exceptions
|
||||
export exceptions
|
||||
@@ -2316,19 +2336,6 @@ when not defined(js):
|
||||
|
||||
|
||||
when notJSnotNims:
|
||||
when hostOS != "standalone" and hostOS != "any":
|
||||
type
|
||||
LibHandle = pointer # private type
|
||||
ProcAddr = pointer # library loading and loading of procs:
|
||||
|
||||
proc nimLoadLibrary(path: string): LibHandle {.compilerproc, hcrInline, nonReloadable.}
|
||||
proc nimUnloadLibrary(lib: LibHandle) {.compilerproc, hcrInline, nonReloadable.}
|
||||
proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr {.compilerproc, hcrInline, nonReloadable.}
|
||||
|
||||
proc nimLoadLibraryError(path: string) {.compilerproc, hcrInline, nonReloadable.}
|
||||
|
||||
include "system/dyncalls"
|
||||
|
||||
import system/countbits_impl
|
||||
include "system/sets"
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{.push stack_trace: off.}
|
||||
|
||||
proc succ*[T, V: Ordinal](x: T, y: V = 1): T {.magic: "Succ", noSideEffect.} =
|
||||
## Returns the `y`-th successor (default: 1) of the value `x`.
|
||||
##
|
||||
@@ -403,3 +405,5 @@ proc `%%`*(x, y: int8): int8 {.inline.} = cast[int8](cast[uint8](x) mod cast[u
|
||||
proc `%%`*(x, y: int16): int16 {.inline.} = cast[int16](cast[uint16](x) mod cast[uint16](y))
|
||||
proc `%%`*(x, y: int32): int32 {.inline.} = cast[int32](cast[uint32](x) mod cast[uint32](y))
|
||||
proc `%%`*(x, y: int64): int64 {.inline.} = cast[int64](cast[uint64](x) mod cast[uint64](y))
|
||||
|
||||
{.pop.}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# However, the interface has been designed to take platform differences into
|
||||
# account and been ported to all major platforms.
|
||||
|
||||
{.push stack_trace: off.}
|
||||
{.push stack_trace: off, checks: off.}
|
||||
|
||||
const
|
||||
NilLibHandle: LibHandle = nil
|
||||
|
||||
@@ -22,10 +22,6 @@ var
|
||||
## instead of `stdmsg.write` when printing stacktrace.
|
||||
## Unstable API.
|
||||
|
||||
when defined(windows):
|
||||
proc GetLastError(): int32 {.header: "<windows.h>", nodecl.}
|
||||
const ERROR_BAD_EXE_FORMAT = 193
|
||||
|
||||
when not defined(windows) or not defined(guiapp):
|
||||
proc writeToStdErr(msg: cstring) = rawWrite(cstderr, msg)
|
||||
proc writeToStdErr(msg: cstring, length: int) =
|
||||
|
||||
Reference in New Issue
Block a user