move widestrs out of system (#20462)
* move widestrs out of system * fix osproc
This commit is contained in:
parent
cbd9fee22a
commit
0b1650576c
29 changed files with 64 additions and 8 deletions
|
|
@ -26,6 +26,8 @@ import asyncdispatch, os
|
|||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/[assertions, syncio]
|
||||
when defined(windows):
|
||||
import std/widestrs
|
||||
|
||||
# TODO: Fix duplication introduced by PR #4683.
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ when defined(nimPreviewSlimSystem):
|
|||
|
||||
when defined(windows):
|
||||
import winlean
|
||||
when useWinUnicode and defined(nimPreviewSlimSystem):
|
||||
import std/widestrs
|
||||
from os import absolutePath
|
||||
else:
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ when not defined(nimscript):
|
|||
else:
|
||||
|
||||
when defined(windows):
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/widestrs
|
||||
proc c_putenv(envstring: cstring): cint {.importc: "_putenv", header: "<stdlib.h>".}
|
||||
from std/private/win_setenv import setEnvImpl
|
||||
proc c_wgetenv(varname: WideCString): WideCString {.importc: "_wgetenv",
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ when not defined(nimscript):
|
|||
|
||||
when defined(windows):
|
||||
import winlean
|
||||
when useWinUnicode and defined(nimPreviewSlimSystem):
|
||||
import std/widestrs
|
||||
|
||||
proc `==`*(err1, err2: OSErrorCode): bool {.borrow.}
|
||||
proc `$`*(err: OSErrorCode): string {.borrow.}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
when defined(windows):
|
||||
import winlean
|
||||
when useWinUnicode and defined(nimPreviewSlimSystem):
|
||||
import std/widestrs
|
||||
elif defined(posix):
|
||||
import posix
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -968,6 +968,9 @@ proc getCacheDir*(app: string): string =
|
|||
when defined(windows):
|
||||
type DWORD = uint32
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/widestrs
|
||||
|
||||
proc getTempPath(
|
||||
nBufferLength: DWORD, lpBuffer: WideCString
|
||||
): DWORD {.stdcall, dynlib: "kernel32.dll", importc: "GetTempPathW".} =
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ when defined(linux) and defined(useClone):
|
|||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/[syncio, assertions]
|
||||
when defined(windows):
|
||||
import std/widestrs
|
||||
|
||||
|
||||
type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue