os: use 1 instead of C.SW_SHOWNORMAL to workaround a cross compilation issue from linux to windows

This commit is contained in:
Delyan Angelov 2024-05-21 19:47:04 +03:00
parent fc45c0a55b
commit 6197140085

View file

@ -17,6 +17,7 @@ pub fn open_uri(uri string) ! {
handle := dl.open_opt('shell32', dl.rtld_now)!
// https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutew
func := ShellExecuteWin(dl.sym_opt(handle, 'ShellExecuteW')!)
func(C.NULL, 'open'.to_wide(), uri.to_wide(), C.NULL, C.NULL, C.SW_SHOWNORMAL)
// 1 is SW_SHOWNORMAL, but it avoids including winuser.h, and in turn windows.h, which conflicts with raylib
func(C.NULL, 'open'.to_wide(), uri.to_wide(), C.NULL, C.NULL, 1)
dl.close(handle)
}