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.

can_unwind

Elf.can_unwind
pub const can_unwind: bool = s:

File

Code

pub const can_unwind: bool = s: {
    const archs: []const std.Target.Cpu.Arch = switch (builtin.target.os.tag) {
        .haiku => &.{
            .aarch64,
            .arm,
            .riscv64,
            .x86,
            .x86_64,
        },
        .illumos => &.{
            .x86,
            .x86_64,
        },
        // Not supported yet: hppa, hppa64, microblaze/microblazeel, sh/sheb
        .linux => &.{
            .aarch64,
            .aarch64_be,
            .alpha,
            .arc,
            .arm,
            .armeb,
            .csky,
            .loongarch32,
            .loongarch64,
            .m68k,
            .mips,
            .mipsel,
            .mips64,
            .mips64el,
            .or1k,
            .riscv32,
            .riscv64,
            .s390x,
            .thumb,
            .thumbeb,
            .x86,
            .x86_64,
        },
        .serenity => &.{
            .aarch64,
            .x86_64,
            .riscv64,
        },

        .dragonfly => &.{
            .x86_64,
        },
        .freebsd => &.{
            .aarch64,
            .arm,
            .riscv64,
            .x86,
            .x86_64,
        },
        // Not supported yet: hppa, mips64/mips64el, sh/sheb
        .netbsd => &.{
            .aarch64,
            .aarch64_be,
            .alpha,
            .arm,
            .armeb,
            .m68k,
            .mips,
            .mipsel,
            .riscv32,
            .riscv64,
            .x86,
            .x86_64,
        },
        // Not supported yet: hppa, sh
        .openbsd => &.{
            .aarch64,
            .arm,
            .m88k,
            .mips64,
            .mips64el,
            .riscv64,
            .x86,
            .x86_64,
        },

        else => unreachable,
    };
    for (archs) |a| {
        if (builtin.target.cpu.arch == a) break :s true;
    }
    break :s false;
}