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.

libCGenericName

LibCDirs.libCGenericName
fn libCGenericName(target: *const std.Target) [:0]const u8

File

lib/std/zig/LibCDirs.zig:237

Code

fn libCGenericName(target: *const std.Target) [:0]const u8 {
    switch (target.os.tag) {
        .windows => return "mingw",
        .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => return "darwin",
        .freebsd => return "freebsd",
        .netbsd => return "netbsd",
        .openbsd => return "openbsd",
        else => {},
    }
    switch (target.abi) {
        .gnu,
        .gnuabin32,
        .gnuabi64,
        .gnueabi,
        .gnueabihf,
        .gnuf32,
        .gnusf,
        .gnux32,
        => return "glibc",
        .musl,
        .muslabin32,
        .muslabi64,
        .musleabi,
        .musleabihf,
        .muslf32,
        .muslsf,
        .muslx32,
        .none,
        .ohos,
        .ohoseabi,
        => return "musl",
        .eabi,
        .eabihf,
        .abin32,
        .x32,
        .ilp32,
        .android,
        .androideabi,
        .msvc,
        .itanium,
        .simulator,
        .call0,
        => unreachable,
    }
}