move widestrs out of system (#20462)

* move widestrs out of system

* fix osproc
This commit is contained in:
metagn 2022-10-01 23:35:09 +03:00 • committed by GitHub
commit 0b1650576c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 64 additions and 8 deletions

View file

@ -2,6 +2,8 @@ discard """
matrix: "--gc:refc; --gc:arc"
"""
import std/widestrs
# bug #19862
type NewString = object

View file

@ -24,6 +24,7 @@ q(a)
# bug #914
when defined(windows):
import std/widestrs
var x = newWideCString("Hello")
echo "success"

View file

@ -7,6 +7,15 @@ discard """
when defined(linux):
import linenoise
when defined(nimPreviewSlimSystem):
import std/[
assertions,
formatfloat,
objectdollar,
syncio,
widestrs,
]
import
algorithm,
asyncdispatch,

View file

@ -4,6 +4,11 @@ discard """
{.warning[UnusedImport]: off.}
when defined(nimPreviewSlimSystem):
import std/[
syncio, assertions, formatfloat, objectdollar, widestrs
]
import std/[
# Core:
bitops, typetraits, lenientops, macros, volatile, typeinfo,

View file

@ -3,5 +3,7 @@ discard """
output: "Test"
"""
import std/widestrs
let ws = newWideCString("Test")
echo ws
echo ws

View file

@ -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>".}

View file

@ -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>".}

View file

@ -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

View file

@ -6,7 +6,9 @@
from stdtest/specialpaths import buildDir
when defined(nimPreviewSlimSystem):
import std/syncio
import std/[
syncio, assertions, formatfloat, objectdollar, widestrs
]
import std/[
# Core: