fix windows build

pull/4180/head
Alexander Medvednikov 2020-04-02 01:14:57 +02:00
parent 74bdc57fad
commit 1cfe44d9c6
3 changed files with 9 additions and 1 deletions

View File

@ -380,6 +380,7 @@ pub fn (a []int) str() string {
for i in 0..a.len {
val := a[i].str()
sb.write(val)
//println('"$val"')
val.free()
if i < a.len - 1 {
sb.write(', ')

View File

@ -21,6 +21,8 @@ fn C.GetConsoleScreenBufferInfo(handle os.HANDLE, info &CONSOLE_SCREEN_BUFFER_IN
// get_terminal_size returns a number of colums and rows of terminal window.
pub fn get_terminal_size() (int, int) {
return 80, 40 // QTODO
/*
if is_atty(1) > 0 && os.getenv('TERM') != 'dumb' {
info := CONSOLE_SCREEN_BUFFER_INFO{}
@ -32,4 +34,5 @@ pub fn get_terminal_size() (int, int) {
}
return default_columns_size, default_rows_size
*/
}

View File

@ -789,7 +789,11 @@ fn (g mut Gen) gen_fn_decl(it ast.FnDecl) {
if g.autofree {
g.writeln('free(_const_os__args.data); // empty, inited in _vinit()')
}
g.writeln('_const_os__args = os__init_os_args(argc, (byteptr*)argv);')
$if windows {
g.writeln('_const_os__args = os__init_os_args(argc, (byteptr*)argv);')
} $else {
g.writeln('_const_os__args = os__init_os_args_wide(argc, (byteptr*)argv);')
}
}
}
g.stmts(it.stmts)