aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-03-19 18:06:16 -0400
committerGitHub <noreply@github.com>2020-03-19 18:06:16 -0400
commitdc04e97098010f590d109e6e70d4afe79cd8f01b (patch)
treebed11818fd80fe7b4557f4253c8d5562de773624 /lib/std/os
parent555a2c03286507ffe4bd3bea2154dbfb719ebef1 (diff)
parent160367e0ddcb36b6957e603d869507b9d7542edc (diff)
downloadzig-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.zig10
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);