mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
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:
@@ -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.} =
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user