Zig 0.17.0-dev (Split by item)

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 library itself.

targetRequiresLibC

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

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

File

lib/std/os.zig:14

Code

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,
    };
}