diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-03-19 18:06:16 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-19 18:06:16 -0400 |
| commit | dc04e97098010f590d109e6e70d4afe79cd8f01b (patch) | |
| tree | bed11818fd80fe7b4557f4253c8d5562de773624 /lib/std/os | |
| parent | 555a2c03286507ffe4bd3bea2154dbfb719ebef1 (diff) | |
| parent | 160367e0ddcb36b6957e603d869507b9d7542edc (diff) | |
| download | zig-dc04e97098010f590d109e6e70d4afe79cd8f01b.tar.gz zig-dc04e97098010f590d109e6e70d4afe79cd8f01b.zip | |
Merge pull request #4752 from ziglang/slice-array
slicing with comptime start and end indexes results in pointer-to-array
Diffstat (limited to 'lib/std/os')
| -rw-r--r-- | lib/std/os/windows.zig | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig index f5acb70adb..813a77c275 100644 --- a/lib/std/os/windows.zig +++ b/lib/std/os/windows.zig @@ -1276,7 +1276,15 @@ pub fn unexpectedError(err: Win32Error) std.os.UnexpectedError { // 614 is the length of the longest windows error desciption var buf_u16: [614]u16 = undefined; var buf_u8: [614]u8 = undefined; - var len = kernel32.FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, err, MAKELANGID(LANG.NEUTRAL, SUBLANG.DEFAULT), buf_u16[0..].ptr, buf_u16.len / @sizeOf(TCHAR), null); + const len = kernel32.FormatMessageW( + FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + null, + err, + MAKELANGID(LANG.NEUTRAL, SUBLANG.DEFAULT), + &buf_u16, + buf_u16.len / @sizeOf(TCHAR), + null, + ); _ = std.unicode.utf16leToUtf8(&buf_u8, buf_u16[0..len]) catch unreachable; std.debug.warn("error.Unexpected: GetLastError({}): {}\n", .{ @enumToInt(err), buf_u8[0..len] }); std.debug.dumpCurrentStackTrace(null); |
