Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

targetRequiresLibC

Public Function
std.os.targetRequiresLibC
pub fn targetRequiresLibC(target: *const std.Target) bool

Returns whether the Zig standard library requires libc in order to interface with the operating system on the given target.

Params

File

os.zig:14
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
pub fn targetRequiresLibC(target: *const std.Target) bool {
    if (target.requiresLibC()) return true;
    return switch (target.os.tag) {
        .linux => switch (target.cpu.arch) {
            // https://codeberg.org/ziglang/zig/issues/30943
            .hppa,
            .hppa64,
            => true,
            else => false,
        },
        .freebsd => true, // https://codeberg.org/ziglang/zig/issues/30981
        .netbsd => true, // https://codeberg.org/ziglang/zig/issues/30980
        .openbsd => true, // https://codeberg.org/ziglang/zig/issues/30982
        else => false,
    };
}