mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 02:44:44 +00:00
@@ -43,6 +43,7 @@ proc setupVM*(module: PSym; scriptName: string): PEvalContext =
|
||||
template cbos(name, body) {.dirty.} =
|
||||
result.registerCallback "stdlib.system." & astToStr(name),
|
||||
proc (a: VmArgs) =
|
||||
errorMsg = nil
|
||||
try:
|
||||
body
|
||||
except OSError:
|
||||
|
||||
@@ -16,4 +16,8 @@ mkDir "bin/nimblepkg"
|
||||
for file in listFiles("nimble" & $id & "/src/nimblepkg/"):
|
||||
cpFile file, "bin/nimblepkg/" & file.extractFilename
|
||||
|
||||
mvFile "nimble" & $id & "/src/nimble".toExe, "bin/nimble".toExe
|
||||
try:
|
||||
mvFile "nimble" & $id & "/src/nimble".toExe, "bin/nimble".toExe
|
||||
except OSError:
|
||||
cpFile "nimble" & $id & "/src/nimble".toExe, "bin/nimble".toExe
|
||||
|
||||
|
||||
@@ -580,9 +580,9 @@ proc moveFile*(source, dest: string) {.rtl, extern: "nos$1",
|
||||
when useWinUnicode:
|
||||
let s = newWideCString(source)
|
||||
let d = newWideCString(dest)
|
||||
if moveFileW(s, d, 0'i32) == 0'i32: raiseOSError(osLastError())
|
||||
if moveFileW(s, d) == 0'i32: raiseOSError(osLastError())
|
||||
else:
|
||||
if moveFileA(source, dest, 0'i32) == 0'i32: raiseOSError(osLastError())
|
||||
if moveFileA(source, dest) == 0'i32: raiseOSError(osLastError())
|
||||
else:
|
||||
if c_rename(source, dest) != 0'i32:
|
||||
raiseOSError(osLastError(), $strerror(errno))
|
||||
|
||||
@@ -116,6 +116,8 @@ template gcAssert(cond: bool, msg: string) =
|
||||
echo "[GCASSERT] ", msg
|
||||
GC_disable()
|
||||
writeStackTrace()
|
||||
#var x: ptr int
|
||||
#echo x[]
|
||||
quit 1
|
||||
|
||||
proc addZCT(s: var CellSeq, c: PCell) {.noinline.} =
|
||||
|
||||
@@ -337,11 +337,10 @@ when useWinUnicode:
|
||||
stdcall, dynlib: "kernel32", importc: "SetFileAttributesW".}
|
||||
|
||||
proc copyFileW*(lpExistingFileName, lpNewFileName: WideCString,
|
||||
bFailIfExists: cint): cint {.
|
||||
bFailIfExists: WINBOOL): WINBOOL {.
|
||||
importc: "CopyFileW", stdcall, dynlib: "kernel32".}
|
||||
|
||||
proc moveFileW*(lpExistingFileName, lpNewFileName: WideCString,
|
||||
bFailIfExists: cint): cint {.
|
||||
proc moveFileW*(lpExistingFileName, lpNewFileName: WideCString): WINBOOL {.
|
||||
importc: "MoveFileW", stdcall, dynlib: "kernel32".}
|
||||
|
||||
proc getEnvironmentStringsW*(): WideCString {.
|
||||
@@ -368,8 +367,7 @@ else:
|
||||
bFailIfExists: cint): cint {.
|
||||
importc: "CopyFileA", stdcall, dynlib: "kernel32".}
|
||||
|
||||
proc moveFileA*(lpExistingFileName, lpNewFileName: cstring,
|
||||
bFailIfExists: cint): cint {.
|
||||
proc moveFileA*(lpExistingFileName, lpNewFileName: cstring): WINBOOL {.
|
||||
importc: "MoveFileA", stdcall, dynlib: "kernel32".}
|
||||
|
||||
proc getEnvironmentStringsA*(): cstring {.
|
||||
@@ -1035,4 +1033,4 @@ when defined(useWinAnsi):
|
||||
else:
|
||||
proc readConsoleInput*(hConsoleInput: Handle, lpBuffer: pointer, nLength: cint,
|
||||
lpNumberOfEventsRead: ptr cint): cint
|
||||
{.stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".}
|
||||
{.stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".}
|
||||
|
||||
Reference in New Issue
Block a user