aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-03-03 21:09:32 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-03-03 21:09:32 -0500
commit3b235cfa807451ee17067ae8a34596b88bbc2eaf (patch)
treefb255aa5d6af551df6b50670f32cc27c3d3a0682 /lib/std
parentf6f0b019bee7910702e113be6d33865c592afa2a (diff)
downloadzig-3b235cfa807451ee17067ae8a34596b88bbc2eaf.tar.gz
zig-3b235cfa807451ee17067ae8a34596b88bbc2eaf.zip
std.zig.CrossTarget: fix compile errors
closes #4620
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/zig/cross_target.zig8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/std/zig/cross_target.zig b/lib/std/zig/cross_target.zig
index 38ce6549f3..f69146bd5f 100644
--- a/lib/std/zig/cross_target.zig
+++ b/lib/std/zig/cross_target.zig
@@ -355,8 +355,10 @@ pub const CrossTarget = struct {
}
pub fn getCpuModel(self: CrossTarget) *const Target.Cpu.Model {
- if (self.cpu_model) |cpu_model| return cpu_model;
- return self.getCpu().model;
+ return switch (self.cpu_model) {
+ .explicit => |cpu_model| cpu_model,
+ else => self.getCpu().model,
+ };
}
pub fn getCpuFeatures(self: CrossTarget) Target.Cpu.Feature.Set {
@@ -645,7 +647,7 @@ pub const CrossTarget = struct {
self.glibc_version = SemVer{ .major = major, .minor = minor, .patch = patch };
}
- pub fn getObjectFormat(self: CrossTarget) ObjectFormat {
+ pub fn getObjectFormat(self: CrossTarget) Target.ObjectFormat {
return Target.getObjectFormatSimple(self.getOsTag(), self.getCpuArch());
}