mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
Windows: unicode command line
This commit is contained in:
parent
93a3521a67
commit
0bbefca875
@ -193,6 +193,7 @@ fn (v mut V) compile() {
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <shellapi.h>
|
||||||
#include <io.h> // _waccess
|
#include <io.h> // _waccess
|
||||||
#include <fcntl.h> // _O_U8TEXT
|
#include <fcntl.h> // _O_U8TEXT
|
||||||
#include <direct.h> // _wgetcwd
|
#include <direct.h> // _wgetcwd
|
||||||
|
@ -6,6 +6,7 @@ import os
|
|||||||
#flag windows @VROOT/thirdparty/microsoft_craziness/microsoft_craziness.o
|
#flag windows @VROOT/thirdparty/microsoft_craziness/microsoft_craziness.o
|
||||||
#flag windows -l ole32
|
#flag windows -l ole32
|
||||||
#flag windows -l oleaut32
|
#flag windows -l oleaut32
|
||||||
|
#flag windows -l shell32
|
||||||
|
|
||||||
// Emily: If these arent included then msvc assumes that
|
// Emily: If these arent included then msvc assumes that
|
||||||
// these return int (which should be 64bit)
|
// these return int (which should be 64bit)
|
||||||
|
@ -93,9 +93,18 @@ fn todo_remove(){}
|
|||||||
|
|
||||||
fn init_os_args(argc int, argv *byteptr) []string {
|
fn init_os_args(argc int, argv *byteptr) []string {
|
||||||
mut args := []string
|
mut args := []string
|
||||||
|
$if windows {
|
||||||
|
mut args_list := &voidptr(0)
|
||||||
|
mut args_count := 0
|
||||||
|
args_list = C.CommandLineToArgvW(C.GetCommandLine(), &args_count)
|
||||||
|
for i := 0; i < args_count; i++ {
|
||||||
|
args << string_from_wide(&u16(args_list[i]))
|
||||||
|
}
|
||||||
|
} $else {
|
||||||
for i := 0; i < argc; i++ {
|
for i := 0; i < argc; i++ {
|
||||||
args << string(argv[i])
|
args << string(argv[i])
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user