added extended msg for failed library loads w/ incorrect DLL formats (#13950)
* added extended msg for failed library loads w/ incorrect DLL formats * missing colon * fix GetLastError() * make GetLastError() available for windows console apps * remove premature nullchar if outputting extra message * if-protect nullchar detection * better fix for message box code
This commit is contained in:
parent
06e0c75ba9
commit
b6f99409a9
2 changed files with 30 additions and 12 deletions
|
|
@ -17,13 +17,15 @@ var
|
|||
## instead of `stdmsg.write` when printing stacktrace.
|
||||
## Unstable API.
|
||||
|
||||
when defined(windows):
|
||||
proc GetLastError(): int32 {.header: "<windows.h>", nodecl.}
|
||||
const ERROR_BAD_EXE_FORMAT = 193
|
||||
|
||||
when not defined(windows) or not defined(guiapp):
|
||||
proc writeToStdErr(msg: cstring) = rawWrite(cstderr, msg)
|
||||
|
||||
else:
|
||||
proc MessageBoxA(hWnd: pointer, lpText, lpCaption: cstring, uType: int): int32 {.
|
||||
header: "<windows.h>", nodecl.}
|
||||
|
||||
proc writeToStdErr(msg: cstring) =
|
||||
discard MessageBoxA(nil, msg, nil, 0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue