enumstd.Target.Os.Tag[src]

Fields

freestanding
other
contiki
elfiamcu
fuchsia
hermit
aix
haiku
hurd
linux
plan9
rtems
serenity
zos
dragonfly
freebsd
netbsd
openbsd
driverkit
ios
macos
tvos
visionos
watchos
illumos
solaris
windows
uefi
ps3
ps4
ps5
emscripten
wasi
amdhsa
amdpal
cuda
mesa3d
nvcl
opencl
opengl
vulkan

Functions

FunctionisDarwin[src]

pub inline fn isDarwin(tag: Tag) bool

Parameters

tag: Tag

Source Code

Source code
pub inline fn isDarwin(tag: Tag) bool {
    return switch (tag) {
        .driverkit,
        .ios,
        .macos,
        .tvos,
        .visionos,
        .watchos,
        => true,
        else => false,
    };
}

FunctionisBSD[src]

pub inline fn isBSD(tag: Tag) bool

Parameters

tag: Tag

Source Code

Source code
pub inline fn isBSD(tag: Tag) bool {
    return tag.isDarwin() or switch (tag) {
        .freebsd, .openbsd, .netbsd, .dragonfly => true,
        else => false,
    };
}

FunctionisSolarish[src]

pub inline fn isSolarish(tag: Tag) bool

Parameters

tag: Tag

Source Code

Source code
pub inline fn isSolarish(tag: Tag) bool {
    return tag == .solaris or tag == .illumos;
}

FunctionexeFileExt[src]

pub fn exeFileExt(tag: Tag, arch: Cpu.Arch) [:0]const u8

Parameters

tag: Tag
arch: Cpu.Arch

Source Code

Source code
pub fn exeFileExt(tag: Tag, arch: Cpu.Arch) [:0]const u8 {
    return switch (tag) {
        .windows => ".exe",
        .uefi => ".efi",
        .plan9 => arch.plan9Ext(),
        else => switch (arch) {
            .wasm32, .wasm64 => ".wasm",
            else => "",
        },
    };
}

FunctionstaticLibSuffix[src]

pub fn staticLibSuffix(tag: Tag, abi: Abi) [:0]const u8

Parameters

tag: Tag
abi: Abi

Source Code

Source code
pub fn staticLibSuffix(tag: Tag, abi: Abi) [:0]const u8 {
    return switch (abi) {
        .msvc, .itanium => ".lib",
        else => switch (tag) {
            .windows, .uefi => ".lib",
            else => ".a",
        },
    };
}

FunctiondynamicLibSuffix[src]

pub fn dynamicLibSuffix(tag: Tag) [:0]const u8

Parameters

tag: Tag

Source Code

Source code
pub fn dynamicLibSuffix(tag: Tag) [:0]const u8 {
    return switch (tag) {
        .windows, .uefi => ".dll",
        .driverkit,
        .ios,
        .macos,
        .tvos,
        .visionos,
        .watchos,
        => ".dylib",
        else => ".so",
    };
}

FunctionlibPrefix[src]

pub fn libPrefix(tag: Os.Tag, abi: Abi) [:0]const u8

Parameters

tag: Os.Tag
abi: Abi

Source Code

Source code
pub fn libPrefix(tag: Os.Tag, abi: Abi) [:0]const u8 {
    return switch (abi) {
        .msvc, .itanium => "",
        else => switch (tag) {
            .windows, .uefi => "",
            else => "lib",
        },
    };
}

FunctiondefaultVersionRange[src]

pub fn defaultVersionRange(tag: Tag, arch: Cpu.Arch, abi: Abi) Os

Parameters

tag: Tag
arch: Cpu.Arch
abi: Abi

Source Code

Source code
pub fn defaultVersionRange(tag: Tag, arch: Cpu.Arch, abi: Abi) Os {
    return .{
        .tag = tag,
        .version_range = .default(arch, tag, abi),
    };
}

FunctionversionRangeTag[src]

pub inline fn versionRangeTag(tag: Tag) @typeInfo(TaggedVersionRange).@"union".tag_type.?

Parameters

tag: Tag

Source Code

Source code
pub inline fn versionRangeTag(tag: Tag) @typeInfo(TaggedVersionRange).@"union".tag_type.? {
    return switch (tag) {
        .freestanding,
        .other,

        .elfiamcu,

        .haiku,
        .plan9,
        .serenity,

        .illumos,

        .ps3,
        .ps4,
        .ps5,

        .emscripten,

        .mesa3d,
        => .none,

        .contiki,
        .fuchsia,
        .hermit,

        .aix,
        .rtems,
        .zos,

        .dragonfly,
        .freebsd,
        .netbsd,
        .openbsd,

        .driverkit,
        .macos,
        .ios,
        .tvos,
        .visionos,
        .watchos,

        .solaris,

        .uefi,

        .wasi,

        .amdhsa,
        .amdpal,
        .cuda,
        .nvcl,
        .opencl,
        .opengl,
        .vulkan,
        => .semver,

        .hurd => .hurd,
        .linux => .linux,

        .windows => .windows,
    };
}

Source Code

Source code
pub const Tag = enum {
    freestanding,
    other,

    contiki,
    elfiamcu,
    fuchsia,
    hermit,

    aix,
    haiku,
    hurd,
    linux,
    plan9,
    rtems,
    serenity,
    zos,

    dragonfly,
    freebsd,
    netbsd,
    openbsd,

    driverkit,
    ios,
    macos,
    tvos,
    visionos,
    watchos,

    illumos,
    solaris,

    windows,
    uefi,

    ps3,
    ps4,
    ps5,

    emscripten,
    wasi,

    amdhsa,
    amdpal,
    cuda,
    mesa3d,
    nvcl,
    opencl,
    opengl,
    vulkan,

    // LLVM tags deliberately omitted:
    // - bridgeos
    // - darwin
    // - kfreebsd
    // - nacl
    // - shadermodel

    pub inline fn isDarwin(tag: Tag) bool {
        return switch (tag) {
            .driverkit,
            .ios,
            .macos,
            .tvos,
            .visionos,
            .watchos,
            => true,
            else => false,
        };
    }

    pub inline fn isBSD(tag: Tag) bool {
        return tag.isDarwin() or switch (tag) {
            .freebsd, .openbsd, .netbsd, .dragonfly => true,
            else => false,
        };
    }

    pub inline fn isSolarish(tag: Tag) bool {
        return tag == .solaris or tag == .illumos;
    }

    pub fn exeFileExt(tag: Tag, arch: Cpu.Arch) [:0]const u8 {
        return switch (tag) {
            .windows => ".exe",
            .uefi => ".efi",
            .plan9 => arch.plan9Ext(),
            else => switch (arch) {
                .wasm32, .wasm64 => ".wasm",
                else => "",
            },
        };
    }

    pub fn staticLibSuffix(tag: Tag, abi: Abi) [:0]const u8 {
        return switch (abi) {
            .msvc, .itanium => ".lib",
            else => switch (tag) {
                .windows, .uefi => ".lib",
                else => ".a",
            },
        };
    }

    pub fn dynamicLibSuffix(tag: Tag) [:0]const u8 {
        return switch (tag) {
            .windows, .uefi => ".dll",
            .driverkit,
            .ios,
            .macos,
            .tvos,
            .visionos,
            .watchos,
            => ".dylib",
            else => ".so",
        };
    }

    pub fn libPrefix(tag: Os.Tag, abi: Abi) [:0]const u8 {
        return switch (abi) {
            .msvc, .itanium => "",
            else => switch (tag) {
                .windows, .uefi => "",
                else => "lib",
            },
        };
    }

    pub fn defaultVersionRange(tag: Tag, arch: Cpu.Arch, abi: Abi) Os {
        return .{
            .tag = tag,
            .version_range = .default(arch, tag, abi),
        };
    }

    pub inline fn versionRangeTag(tag: Tag) @typeInfo(TaggedVersionRange).@"union".tag_type.? {
        return switch (tag) {
            .freestanding,
            .other,

            .elfiamcu,

            .haiku,
            .plan9,
            .serenity,

            .illumos,

            .ps3,
            .ps4,
            .ps5,

            .emscripten,

            .mesa3d,
            => .none,

            .contiki,
            .fuchsia,
            .hermit,

            .aix,
            .rtems,
            .zos,

            .dragonfly,
            .freebsd,
            .netbsd,
            .openbsd,

            .driverkit,
            .macos,
            .ios,
            .tvos,
            .visionos,
            .watchos,

            .solaris,

            .uefi,

            .wasi,

            .amdhsa,
            .amdpal,
            .cuda,
            .nvcl,
            .opencl,
            .opengl,
            .vulkan,
            => .semver,

            .hurd => .hurd,
            .linux => .linux,

            .windows => .windows,
        };
    }
}