-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
introduce operating system version ranges as part of the target #1907
Copy link
Copy link
Closed
Labels
acceptedThis proposal is planned.This proposal is planned.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.proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.This issue suggests language modifications. If it also has the "accepted" label then it is planned.
Milestone
Metadata
Metadata
Assignees
Labels
acceptedThis proposal is planned.This proposal is planned.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.proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.This issue suggests language modifications. If it also has the "accepted" label then it is planned.
On Linux we have kernel versions:
3.14,4.14,4.18, etc.On Windows we have versions, e.g.
FreeBSD has the concept of versions: most recent e.g. 12.0
MacOS / iOS has the concept of versions too - e.g. 10.14.3
I propose for OS minimum version and maximum version to be part of the target. When you specify an OS minimum version as part of the target, it is telling userland code what ABI it can rely on. Each OS will have a default minimum version. Some standard library functions (or functions from third party packages) may give a
@compileError("this API supported only on OS version xyz and later"). The OS minimum version will be available for userland code to observe in@import("builtin").Maximum version is also useful, because it can avoid code bloat, when it is compile-time known that the code will not be able to take advantage of newer OS features.
When compiling for the native target, the minimum and maximum OS versions will be the same.