mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 13:58:27 +00:00
std: Remove duplicated code
Make osRequiresLibC call Os.requiresLibC, let's keep a single list of OS that require the libc to be linked in.
This commit is contained in:
parent
daed2ba2a0
commit
2622575fde
@ -337,6 +337,9 @@ pub const Target = struct {
|
||||
};
|
||||
}
|
||||
|
||||
/// On Darwin, we always link libSystem which contains libc.
|
||||
/// Similarly on FreeBSD and NetBSD we always link system libc
|
||||
/// since this is the stable syscall interface.
|
||||
pub fn requiresLibC(os: Os) bool {
|
||||
return switch (os.tag) {
|
||||
.freebsd,
|
||||
|
||||
@ -128,10 +128,7 @@ pub fn cannotDynamicLink(target: std.Target) bool {
|
||||
/// Similarly on FreeBSD and NetBSD we always link system libc
|
||||
/// since this is the stable syscall interface.
|
||||
pub fn osRequiresLibC(target: std.Target) bool {
|
||||
return switch (target.os.tag) {
|
||||
.freebsd, .netbsd, .dragonfly, .openbsd, .macos, .ios, .watchos, .tvos => true,
|
||||
else => false,
|
||||
};
|
||||
return target.os.requiresLibC();
|
||||
}
|
||||
|
||||
pub fn libcNeedsLibUnwind(target: std.Target) bool {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user