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/c/darwin.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std/c') diff --git a/lib/std/c/darwin.zig b/lib/std/c/darwin.zig index f2e8120a0e..ebd12a0d86 100644 --- a/lib/std/c/darwin.zig +++ b/lib/std/c/darwin.zig @@ -36,7 +36,7 @@ const mach_hdr = if (@sizeOf(usize) == 8) mach_header_64 else mach_header; /// export a weak symbol here, to be overridden by the real one. pub extern "c" var _mh_execute_header: mach_hdr = undefined; comptime { - if (std.os.darwin.is_the_target) { + if (std.Target.current.isDarwin()) { @export("_mh_execute_header", _mh_execute_header, .Weak); } } -- cgit v1.2.3