zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 078a64f8d9b50ad99afe12ba3038afc3e68f507c (tree)
parent 307d98dc35354c6562bb0c12cc79710f6b8a4c01
Author: Isaac Freund <ifreund@ifreund.xyz>
Date:   Sat, 12 Dec 2020 02:14:06 +0100

std.CrossTarget: add isNativeAbi()

Diffstat:
Mlib/std/zig/cross_target.zig | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/std/zig/cross_target.zig b/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 {