1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

term.ui: fix conflicting C struct declarations when compiling programs, importing term.ui before term, on windows

This commit is contained in:
Delyan Angelov 2022-03-29 09:26:14 +03:00
parent 509367b293
commit 4f551d76c0
3 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,8 @@
import term.ui
import term
fn test_term_and_term_ui_can_compile_together() {
a := &ui.Context(0)
println('${term.bold('hello')} world ${int(a)}')
assert true
}

View File

@ -0,0 +1,8 @@
import term
import term.ui
fn test_term_and_term_ui_can_compile_together() {
a := &ui.Context(0)
println('${term.bold('hello')} world ${int(a)}')
assert true
}

View File

@ -15,6 +15,7 @@ struct C.INPUT_RECORD {
} }
union C.uChar { union C.uChar {
mut:
UnicodeChar rune UnicodeChar rune
AsciiChar byte AsciiChar byte
} }
@ -54,12 +55,14 @@ struct C.FOCUS_EVENT_RECORD {
[typedef] [typedef]
struct C.COORD { struct C.COORD {
mut:
X i16 X i16
Y i16 Y i16
} }
[typedef] [typedef]
struct C.SMALL_RECT { struct C.SMALL_RECT {
mut:
Left u16 Left u16
Top u16 Top u16
Right u16 Right u16
@ -68,6 +71,7 @@ struct C.SMALL_RECT {
[typedef] [typedef]
struct C.CONSOLE_SCREEN_BUFFER_INFO { struct C.CONSOLE_SCREEN_BUFFER_INFO {
mut:
dwSize C.COORD dwSize C.COORD
dwCursorPosition C.COORD dwCursorPosition C.COORD
wAttributes u16 wAttributes u16