std.zig.CrossTarget: fix compile errors

closes #4620
This commit is contained in:
Andrew Kelley 2020-03-03 21:09:32 -05:00
parent f6f0b019be
commit 3b235cfa80
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -355,8 +355,10 @@ pub const CrossTarget = struct {
} }
pub fn getCpuModel(self: CrossTarget) *const Target.Cpu.Model { pub fn getCpuModel(self: CrossTarget) *const Target.Cpu.Model {
if (self.cpu_model) |cpu_model| return cpu_model; return switch (self.cpu_model) {
return self.getCpu().model; .explicit => |cpu_model| cpu_model,
else => self.getCpu().model,
};
} }
pub fn getCpuFeatures(self: CrossTarget) Target.Cpu.Feature.Set { 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 }; 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()); return Target.getObjectFormatSimple(self.getOsTag(), self.getCpuArch());
} }