mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 00:26:57 +00:00
fixed mismatched types
This commit is contained in:
parent
0aabfb09f9
commit
0288034c2f
@ -630,6 +630,7 @@ set(ZIG_STD_FILES
|
||||
"os/windows/bits.zig"
|
||||
"os/windows/error.zig"
|
||||
"os/windows/kernel32.zig"
|
||||
"os/windows/lang.zig"
|
||||
"os/windows/ntdll.zig"
|
||||
"os/windows/ole32.zig"
|
||||
"os/windows/shell32.zig"
|
||||
|
@ -756,7 +756,7 @@ pub fn sliceToPrefixedSuffixedFileW(s: []const u8, comptime suffix: []const u16)
|
||||
return result;
|
||||
}
|
||||
|
||||
inline fn MAKELANGID(p: USHORT, s: USHORT) LANGID {
|
||||
inline fn MAKELANGID(p: c_ushort, s: c_ushort) LANGID {
|
||||
return (s << 10) | p;
|
||||
}
|
||||
|
||||
@ -765,7 +765,7 @@ inline fn MAKELANGID(p: USHORT, s: USHORT) LANGID {
|
||||
pub fn unexpectedError(err: DWORD) std.os.UnexpectedError {
|
||||
if (std.os.unexpected_error_tracing) {
|
||||
var buf: LPSTR = undefined;
|
||||
const len = kernel32.FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, err, MAKELANGID(LANG.LANG_NEUTRAL, LANG.SUBLANG_DEFAULT), buf, 0, null);
|
||||
const len = kernel32.FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, err, MAKELANGID(LANG.LANG_NEUTRAL, LANG.SUBLANG_DEFAULT), @ptrCast(LPSTR, &buf), 0, null);
|
||||
defer _ = kernel32.LocalFree(@ptrCast(HLOCAL, buf));
|
||||
std.debug.warn("error.Unexpected: {}: {}\n", err, buf[0..len]);
|
||||
|
||||
|
@ -50,7 +50,7 @@ pub extern "kernel32" stdcallcc fn FindFirstFileW(lpFileName: [*]const u16, lpFi
|
||||
pub extern "kernel32" stdcallcc fn FindClose(hFindFile: HANDLE) BOOL;
|
||||
pub extern "kernel32" stdcallcc fn FindNextFileW(hFindFile: HANDLE, lpFindFileData: *WIN32_FIND_DATAW) BOOL;
|
||||
|
||||
pub extern "kernel32" stdcallcc fn FormatMessageA(dwFlags: DWORD, lpSource: LPVOID, dwMessageId: DWORD, dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD, Arguments: ?*va_list) DWORD;
|
||||
pub extern "kernel32" stdcallcc fn FormatMessageA(dwFlags: DWORD, lpSource: ?LPVOID, dwMessageId: DWORD, dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD, Arguments: ?*va_list) DWORD;
|
||||
|
||||
pub extern "kernel32" stdcallcc fn FreeEnvironmentStringsW(penv: [*]u16) BOOL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user