fix windows build
parent
74bdc57fad
commit
1cfe44d9c6
|
@ -380,6 +380,7 @@ pub fn (a []int) str() string {
|
||||||
for i in 0..a.len {
|
for i in 0..a.len {
|
||||||
val := a[i].str()
|
val := a[i].str()
|
||||||
sb.write(val)
|
sb.write(val)
|
||||||
|
//println('"$val"')
|
||||||
val.free()
|
val.free()
|
||||||
if i < a.len - 1 {
|
if i < a.len - 1 {
|
||||||
sb.write(', ')
|
sb.write(', ')
|
||||||
|
|
|
@ -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.
|
// get_terminal_size returns a number of colums and rows of terminal window.
|
||||||
pub fn get_terminal_size() (int, int) {
|
pub fn get_terminal_size() (int, int) {
|
||||||
|
return 80, 40 // QTODO
|
||||||
|
/*
|
||||||
if is_atty(1) > 0 && os.getenv('TERM') != 'dumb' {
|
if is_atty(1) > 0 && os.getenv('TERM') != 'dumb' {
|
||||||
info := CONSOLE_SCREEN_BUFFER_INFO{}
|
info := CONSOLE_SCREEN_BUFFER_INFO{}
|
||||||
|
|
||||||
|
@ -32,4 +34,5 @@ pub fn get_terminal_size() (int, int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return default_columns_size, default_rows_size
|
return default_columns_size, default_rows_size
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -789,7 +789,11 @@ fn (g mut Gen) gen_fn_decl(it ast.FnDecl) {
|
||||||
if g.autofree {
|
if g.autofree {
|
||||||
g.writeln('free(_const_os__args.data); // empty, inited in _vinit()')
|
g.writeln('free(_const_os__args.data); // empty, inited in _vinit()')
|
||||||
}
|
}
|
||||||
|
$if windows {
|
||||||
g.writeln('_const_os__args = os__init_os_args(argc, (byteptr*)argv);')
|
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)
|
g.stmts(it.stmts)
|
||||||
|
|
Loading…
Reference in New Issue