From 60cd11bd4b48e4dfdf11d1f25cb1ee842a49ee1d Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 24 Oct 2019 01:06:03 -0400 Subject: get rid of std.os.foo.is_the_target It had the downside of running all the comptime blocks and resolving all the usingnamespaces of each system, when just trying to discover if the current system is a particular one. For Darwin, where it's nice to use `std.Target.current.isDarwin()`, this demonstrates the utility that #425 would provide. --- lib/std/os/test.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/std/os/test.zig') diff --git a/lib/std/os/test.zig b/lib/std/os/test.zig index b6e6728142..1d61548396 100644 --- a/lib/std/os/test.zig +++ b/lib/std/os/test.zig @@ -53,7 +53,7 @@ test "std.Thread.getCurrentId" { thread.wait(); if (Thread.use_pthreads) { expect(thread_current_id == thread_id); - } else if (os.windows.is_the_target) { + } else if (builtin.os == .windows) { expect(Thread.getCurrentId() != thread_current_id); } else { // If the thread completes very quickly, then thread_id can be 0. See the @@ -212,7 +212,7 @@ test "dl_iterate_phdr" { } test "gethostname" { - if (os.windows.is_the_target) + if (builtin.os == .windows) return error.SkipZigTest; var buf: [os.HOST_NAME_MAX]u8 = undefined; @@ -221,7 +221,7 @@ test "gethostname" { } test "pipe" { - if (os.windows.is_the_target) + if (builtin.os == .windows) return error.SkipZigTest; var fds = try os.pipe(); -- cgit v1.2.3