Skip to content

Commit

Permalink
os: use 1 instead of C.SW_SHOWNORMAL to workaround a cross compilatio…
Browse files Browse the repository at this point in the history
…n issue from linux to windows
  • Loading branch information
spytheman committed May 21, 2024
1 parent fc45c0a commit 6197140
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vlib/os/open_uri_windows.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 6197140

Please sign in to comment.