migrate from std.Target.current to @import("builtin").target

closes #9388
closes #9321
This commit is contained in:
Andrew Kelley
2021-10-04 23:47:27 -07:00
parent 78902db68b
commit 6115cf2240
147 changed files with 624 additions and 596 deletions
+4 -2
View File
@@ -1,4 +1,5 @@
const std = @import("std");
const builtin = @import("builtin");
const TestContext = @import("../src/test.zig").TestContext;
pub fn addCases(ctx: *TestContext) !void {
@@ -2898,7 +2899,7 @@ pub fn addCases(ctx: *TestContext) !void {
"tmp.zig:2:18: error: invalid operands to binary expression: 'error{A}' and 'error{B}'",
});
if (std.Target.current.os.tag == .linux) {
if (builtin.os.tag == .linux) {
ctx.testErrStage1("implicit dependency on libc",
\\extern "c" fn exit(u8) void;
\\export fn entry() void {
@@ -8834,9 +8835,10 @@ pub fn addCases(ctx: *TestContext) !void {
ctx.objErrStage1("Issue #9165: windows tcp server compilation error",
\\const std = @import("std");
\\const builtin = @import("builtin");
\\pub const io_mode = .evented;
\\pub fn main() !void {
\\ if (std.builtin.os.tag == .windows) {
\\ if (builtin.os.tag == .windows) {
\\ _ = try (std.net.StreamServer.init(.{})).accept();
\\ } else {
\\ @compileError("Unsupported OS");