authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-14 17:10:53-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-14 17:10:53-04:00
logad6eec94804d4bfc8c16ea8c852cd32f1f822e97
treea5cd5e9199336f51bfe64179e31cd4c14b231d12
parent0307dc0b774daa20c3258e3bd3330f5316c118cf

fix regressions from previous commit on windows


1 files changed, 3 insertions(+), 2 deletions(-)

std/os/windows/util.zig+3-2
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1const std = @import("../../index.zig");1const std = @import("../../index.zig");
2const os = std.os;
2const windows = std.os.windows;3const windows = std.os.windows;
3const assert = std.debug.assert;4const assert = std.debug.assert;
4const mem = std.mem;5const mem = std.mem;
...@@ -75,9 +76,9 @@ error PipeBusy;...@@ -75,9 +76,9 @@ error PipeBusy;
75/// size buffer is too small, and the provided allocator is null, ::error.NameTooLong is returned.76/// size buffer is too small, and the provided allocator is null, ::error.NameTooLong is returned.
76/// otherwise if the fixed size buffer is too small, allocator is used to obtain the needed memory.77/// otherwise if the fixed size buffer is too small, allocator is used to obtain the needed memory.
77pub fn windowsOpen(file_path: []const u8, desired_access: windows.DWORD, share_mode: windows.DWORD,78pub fn windowsOpen(file_path: []const u8, desired_access: windows.DWORD, share_mode: windows.DWORD,
78 creation_disposition: windows.DWORD, flags_and_attrs: windows.DWORD, allocator: ?&Allocator) -> %windows.HANDLE79 creation_disposition: windows.DWORD, flags_and_attrs: windows.DWORD, allocator: ?&mem.Allocator) -> %windows.HANDLE
79{80{
80 var stack_buf: [max_noalloc_path_len]u8 = undefined;81 var stack_buf: [os.max_noalloc_path_len]u8 = undefined;
81 var path0: []u8 = undefined;82 var path0: []u8 = undefined;
82 var need_free = false;83 var need_free = false;
83 defer if (need_free) (??allocator).free(path0);84 defer if (need_free) (??allocator).free(path0);