Commit 078a64f8d9

Isaac Freund <ifreund@ifreund.xyz>
2020-12-12 02:14:06
std.CrossTarget: add isNativeAbi()
1 parent 307d98d
Changed files (1)
lib
lib/std/zig/cross_target.zig
@@ -500,8 +500,12 @@ pub const CrossTarget = struct {
             self.dynamic_linker.get() == null and self.glibc_version == null;
     }
 
+    pub fn isNativeAbi(self: CrossTarget) bool {
+        return self.os_tag == null and self.abi == null;
+    }
+
     pub fn isNative(self: CrossTarget) bool {
-        return self.isNativeCpu() and self.isNativeOs() and self.abi == null;
+        return self.isNativeCpu() and self.isNativeOs() and self.isNativeAbi();
     }
 
     pub fn zigTriple(self: CrossTarget, allocator: *mem.Allocator) error{OutOfMemory}![]u8 {