-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.os-freebsdstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
This is a follow-up task from #4550.
Lines 229 to 231 in 7617610
.freebsd => { | |
// TODO Detect native operating system version. | |
}, |
Lines 115 to 181 in 7617610
/// The version ranges here represent the minimum OS version to be supported | |
/// and the maximum OS version to be supported. The default values represent | |
/// the range that the Zig Standard Library bases its abstractions on. | |
/// | |
/// The minimum version of the range is the main setting to tweak for a target. | |
/// Usually, the maximum target OS version will remain the default, which is | |
/// the latest released version of the OS. | |
/// | |
/// To test at compile time if the target is guaranteed to support a given OS feature, | |
/// one should check that the minimum version of the range is greater than or equal to | |
/// the version the feature was introduced in. | |
/// | |
/// To test at compile time if the target certainly will not support a given OS feature, | |
/// one should check that the maximum version of the range is less than the version the | |
/// feature was introduced in. | |
/// | |
/// If neither of these cases apply, a runtime check should be used to determine if the | |
/// target supports a given OS feature. | |
/// | |
/// Binaries built with a given maximum version will continue to function on newer operating system | |
/// versions. However, such a binary may not take full advantage of the newer operating system APIs. | |
pub const VersionRange = union { | |
none: void, | |
semver: Version.Range, | |
linux: LinuxVersionRange, | |
windows: WindowsVersion.Range, | |
/// The default `VersionRange` represents the range that the Zig Standard Library | |
/// bases its abstractions on. | |
pub fn default(tag: Tag) VersionRange { | |
switch (tag) { | |
.freestanding, | |
.ananas, | |
.cloudabi, | |
.dragonfly, | |
.fuchsia, | |
.kfreebsd, | |
.lv2, | |
.solaris, | |
.haiku, | |
.minix, | |
.rtems, | |
.nacl, | |
.cnk, | |
.aix, | |
.cuda, | |
.nvcl, | |
.amdhsa, | |
.ps4, | |
.elfiamcu, | |
.mesa3d, | |
.contiki, | |
.amdpal, | |
.hermit, | |
.hurd, | |
.wasi, | |
.emscripten, | |
.uefi, | |
.other, | |
=> return .{ .none = {} }, | |
.freebsd => return .{ | |
.semver = Version.Range{ | |
.min = .{ .major = 12, .minor = 0 }, | |
.max = .{ .major = 12, .minor = 1 }, | |
}, | |
}, |
Metadata
Metadata
Assignees
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.os-freebsdstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.