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

cgen: remove the need for [console] for gg or ui programs on windows (#15912)

This commit is contained in:
Larpon
2022-09-29 14:02:50 +02:00
committed by GitHub
parent 79a473f8ec
commit 816e9319d7
21 changed files with 28 additions and 37 deletions

View File

@@ -6175,9 +6175,11 @@ fn C.DefWindowProc(hwnd int, msg int, lparam int, wparam int)
type FastFn = fn (int) bool
// Windows only:
// If a default graphics library is imported (ex. gg, ui), then the graphical window takes
// priority and no console window is created, effectively disabling println() statements.
// Use to explicitly create console window. Valid before main() only.
// Without this attribute all graphical apps will have the following behavior on Windows:
// If run from a console or terminal; keep the terminal open so all (e)println statements can be viewed.
// If run from e.g. Explorer, by double-click; app is opened, but no terminal is opened, and no (e)println output can be seen.
// Use it to force-open a terminal to view output in, even if the app is started from Explorer.
// Valid before main() only.
[console]
fn main() {
}