browsers module should compile on windows again
This commit is contained in:
parent
f9876d379d
commit
f2222316bd
1 changed files with 8 additions and 1 deletions
|
|
@ -26,7 +26,14 @@ proc openDefaultBrowser*(url: string) =
|
|||
## Otherwise the environment variable ``BROWSER`` is used to determine the
|
||||
## default browser to use.
|
||||
when defined(windows):
|
||||
discard ShellExecute(0'i32, "open", url, nil, nil, SW_SHOWNORMAL)
|
||||
when useWinUnicode:
|
||||
var o = allocWideCString("open")
|
||||
var u = allocWideCString(url)
|
||||
discard ShellExecuteW(0'i32, o, u, nil, nil, SW_SHOWNORMAL)
|
||||
dealloc o
|
||||
dealloc u
|
||||
else:
|
||||
discard ShellExecuteA(0'i32, "open", url, nil, nil, SW_SHOWNORMAL)
|
||||
elif defined(macosx):
|
||||
discard execShellCmd("open " & quoteIfContainsWhite(url))
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue