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
|
|
@ -3,5 +3,7 @@ discard """
|
|||
output: "Test"
|
||||
"""
|
||||
|
||||
import std/widestrs
|
||||
|
||||
let ws = newWideCString("Test")
|
||||
echo ws
|
||||
echo ws
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ template main =
|
|||
main()
|
||||
|
||||
when defined(windows):
|
||||
import std/widestrs
|
||||
proc c_wgetenv(env: WideCString): WideCString {.importc: "_wgetenv", header: "<stdlib.h>".}
|
||||
proc c_getenv(env: cstring): cstring {.importc: "getenv", header: "<stdlib.h>".}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ static: main()
|
|||
main()
|
||||
|
||||
when defined(windows):
|
||||
import std/widestrs
|
||||
proc c_wgetenv(env: WideCString): WideCString {.importc: "_wgetenv", header: "<stdlib.h>".}
|
||||
proc c_getenv(env: cstring): cstring {.importc: "getenv", header: "<stdlib.h>".}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import std/[syncio, assertions]
|
|||
when not defined(windows):
|
||||
echo "OK"
|
||||
else:
|
||||
import std/widestrs
|
||||
{.push gcsafe.}
|
||||
|
||||
const CP_UTF8 = 65001'i32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue