Make HWND a pointer instead of a cint and fix MSVC compiler warning (#10789)
In Windows, a HWND is a HANDLE which is a PVOID so a pointer in Nim
This commit is contained in:
parent
cd3a58d7b0
commit
b270917de1
2 changed files with 3 additions and 3 deletions
|
|
@ -30,7 +30,7 @@ proc nimLoadLibraryError(path: string) =
|
||||||
var msg: array[1000, char]
|
var msg: array[1000, char]
|
||||||
copyMem(msg[0].addr, prefix.cstring, prefix.len)
|
copyMem(msg[0].addr, prefix.cstring, prefix.len)
|
||||||
copyMem(msg[prefix.len].addr, path.cstring, min(path.len + 1, 1000 - prefix.len))
|
copyMem(msg[prefix.len].addr, path.cstring, min(path.len + 1, 1000 - prefix.len))
|
||||||
discard MessageBoxA(0, msg[0].addr, nil, 0)
|
discard MessageBoxA(nil, msg[0].addr, nil, 0)
|
||||||
quit(1)
|
quit(1)
|
||||||
|
|
||||||
proc procAddrError(name: cstring) {.compilerproc, nonReloadable, hcrInline.} =
|
proc procAddrError(name: cstring) {.compilerproc, nonReloadable, hcrInline.} =
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,11 @@ when not defined(windows) or not defined(guiapp):
|
||||||
proc writeToStdErr(msg: cstring) = rawWrite(cstderr, msg)
|
proc writeToStdErr(msg: cstring) = rawWrite(cstderr, msg)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
proc MessageBoxA(hWnd: cint, lpText, lpCaption: cstring, uType: int): int32 {.
|
proc MessageBoxA(hWnd: pointer, lpText, lpCaption: cstring, uType: int): int32 {.
|
||||||
header: "<windows.h>", nodecl.}
|
header: "<windows.h>", nodecl.}
|
||||||
|
|
||||||
proc writeToStdErr(msg: cstring) =
|
proc writeToStdErr(msg: cstring) =
|
||||||
discard MessageBoxA(0, msg, nil, 0)
|
discard MessageBoxA(nil, msg, nil, 0)
|
||||||
|
|
||||||
proc showErrorMessage(data: cstring) {.gcsafe.} =
|
proc showErrorMessage(data: cstring) {.gcsafe.} =
|
||||||
if errorMessageWriter != nil:
|
if errorMessageWriter != nil:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue