Skip to content

Commit

Permalink
Merge branch 'stratact-no-dir-allocators'
Browse files Browse the repository at this point in the history
closes #2885
closes #2886
closes #2888
closes #3249
  • Loading branch information
andrewrk committed Oct 22, 2019
2 parents a5cc758 + 064377b commit e839250
Show file tree
Hide file tree
Showing 25 changed files with 1,089 additions and 411 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -630,5 +630,8 @@ set_target_properties(zig PROPERTIES
LINK_FLAGS ${EXE_LDFLAGS}
)
target_link_libraries(zig compiler "${LIBUSERLAND}")
if(MSVC)
target_link_libraries(zig ntdll.lib)
endif()
add_dependencies(zig zig_build_libuserland)
install(TARGETS zig DESTINATION bin)
2 changes: 1 addition & 1 deletion doc/docgen.zig
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn main() !void {
var toc = try genToc(allocator, &tokenizer);

try fs.makePath(allocator, tmp_dir_name);
defer fs.deleteTree(allocator, tmp_dir_name) catch {};
defer fs.deleteTree(tmp_dir_name) catch {};

try genHtml(allocator, &tokenizer, &toc, &buffered_out_stream.stream, zig_exe);
try buffered_out_stream.flush();
Expand Down
4 changes: 2 additions & 2 deletions lib/std/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ pub const Builder = struct {
if (self.verbose) {
warn("rm {}\n", full_path);
}
fs.deleteTree(self.allocator, full_path) catch {};
fs.deleteTree(full_path) catch {};
}

// TODO remove empty directories
Expand Down Expand Up @@ -2687,7 +2687,7 @@ pub const RemoveDirStep = struct {
const self = @fieldParentPtr(RemoveDirStep, "step", step);

const full_path = self.builder.pathFromRoot(self.dir_path);
fs.deleteTree(self.builder.allocator, full_path) catch |err| {
fs.deleteTree(full_path) catch |err| {
warn("Unable to remove {}: {}\n", full_path, @errorName(err));
return err;
};
Expand Down
1 change: 1 addition & 0 deletions lib/std/c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ pub extern "c" fn mmap(addr: ?*align(page_size) c_void, len: usize, prot: c_uint
pub extern "c" fn munmap(addr: *align(page_size) c_void, len: usize) c_int;
pub extern "c" fn mprotect(addr: *align(page_size) c_void, len: usize, prot: c_uint) c_int;
pub extern "c" fn unlink(path: [*]const u8) c_int;
pub extern "c" fn unlinkat(dirfd: fd_t, path: [*]const u8, flags: c_uint) c_int;
pub extern "c" fn getcwd(buf: [*]u8, size: usize) ?[*]u8;
pub extern "c" fn waitpid(pid: c_int, stat_loc: *c_uint, options: c_uint) c_int;
pub extern "c" fn fork() c_int;
Expand Down
2 changes: 1 addition & 1 deletion lib/std/event/fs.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ const test_tmp_dir = "std_event_fs_test";
//
// // TODO move this into event loop too
// try os.makePath(allocator, test_tmp_dir);
// defer os.deleteTree(allocator, test_tmp_dir) catch {};
// defer os.deleteTree(test_tmp_dir) catch {};
//
// var loop: Loop = undefined;
// try loop.initMultiThreaded(allocator);
Expand Down
Loading

0 comments on commit e839250

Please sign in to comment.