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

pull/13858/head
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 {
mut:
UnicodeChar rune
AsciiChar byte
}
@ -54,12 +55,14 @@ struct C.FOCUS_EVENT_RECORD {
[typedef]
struct C.COORD {
mut:
X i16
Y i16
}
[typedef]
struct C.SMALL_RECT {
mut:
Left u16
Top u16
Right u16
@ -68,6 +71,7 @@ struct C.SMALL_RECT {
[typedef]
struct C.CONSOLE_SCREEN_BUFFER_INFO {
mut:
dwSize C.COORD
dwCursorPosition C.COORD
wAttributes u16