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:
Bogdan
2019-03-13 16:54:36 +02:00
committed by Andreas Rumpf
parent cd3a58d7b0
commit b270917de1
2 changed files with 3 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ proc nimLoadLibraryError(path: string) =
var msg: array[1000, char]
copyMem(msg[0].addr, prefix.cstring, 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)
proc procAddrError(name: cstring) {.compilerproc, nonReloadable, hcrInline.} =

View File

@@ -28,11 +28,11 @@ when not defined(windows) or not defined(guiapp):
proc writeToStdErr(msg: cstring) = rawWrite(cstderr, msg)
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.}
proc writeToStdErr(msg: cstring) =
discard MessageBoxA(0, msg, nil, 0)
discard MessageBoxA(nil, msg, nil, 0)
proc showErrorMessage(data: cstring) {.gcsafe.} =
if errorMessageWriter != nil: