Skip to content

Commit 01691cf

Browse files
committed
fix compile error in analysis_check.zig when building for wasm32-wasi
1 parent 7855c40 commit 01691cf

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

tests/analysis_check.zig

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,9 @@ pub fn main() Error!void {
103103
config.zig_lib_dir = .{ .handle = .{ .fd = zig_lib_dir_fd }, .path = "/lib" };
104104
}
105105

106-
var thread_pool: if (builtin.single_threaded) void else std.Thread.Pool = undefined;
107-
if (builtin.single_threaded) {
108-
thread_pool = {};
109-
} else {
110-
thread_pool.init(.{
111-
.allocator = gpa,
112-
}) catch std.debug.panic("failed to initalize thread pool", .{});
113-
}
114-
defer if (!builtin.single_threaded) thread_pool.deinit();
106+
var thread_pool: std.Thread.Pool = undefined;
107+
thread_pool.init(.{ .allocator = gpa }) catch std.debug.panic("failed to initalize thread pool", .{});
108+
defer thread_pool.deinit();
115109

116110
var ip: InternPool = try .init(gpa);
117111
defer ip.deinit(gpa);
@@ -122,7 +116,7 @@ pub fn main() Error!void {
122116
var document_store: zls.DocumentStore = .{
123117
.allocator = gpa,
124118
.config = config,
125-
.thread_pool = if (builtin.single_threaded) {} else &thread_pool,
119+
.thread_pool = &thread_pool,
126120
.diagnostics_collection = &diagnostics_collection,
127121
};
128122
defer document_store.deinit();

0 commit comments

Comments
 (0)