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.
Zig › std/ › os.zig
os.zig
Index
File
Code
const builtin = @import ("builtin" );
const std = @import ("std.zig" );
const native_os = builtin .os .tag ;
pub const linux = @import ("os/linux.zig" );
pub const plan9 = @import ("os/plan9.zig" );
pub const uefi = @import ("os/uefi.zig" );
pub const wasi = @import ("os/wasi.zig" );
pub const emscripten = @import ("os/emscripten.zig" );
pub const windows = @import ("os/windows.zig" );
pub fn targetRequiresLibC (target : *const std .Target ) bool {
if (target .requiresLibC ()) return true ;
return switch (target .os .tag ) {
.linux => switch (target .cpu .arch ) {
.hppa ,
.hppa64 ,
=> true ,
else => false ,
},
.freebsd => true ,
.netbsd => true ,
.openbsd => true ,
else => false ,
};
}
pub fn requiresLibC () bool {
return targetRequiresLibC (&builtin .target );
}
test {
_ = linux ;
if (native_os == .uefi ) _ = uefi ;
_ = wasi ;
_ = windows ;
}