authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-02-28 16:27:49-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-15 10:48:13-07:00
log6d88c3e935357e73493a0d10cd85dd2676f6b85b
tree3a8920002a42196bfc02e48fb00c40254a12fff5
parent6f717b18f05ba02439603e0987e9c9551fbadedb

add builtin.zig_version_string

sometimes this is more useful than SemanticVersion

1 files changed, 2 insertions(+), 1 deletions(-)

src/Compilation.zig+2-1
...@@ -5056,7 +5056,8 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: Allocator) Alloca...@@ -5056,7 +5056,8 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: Allocator) Alloca
5056 \\const std = @import("std");5056 \\const std = @import("std");
5057 \\/// Zig version. When writing code that supports multiple versions of Zig, prefer5057 \\/// Zig version. When writing code that supports multiple versions of Zig, prefer
5058 \\/// feature detection (i.e. with `@hasDecl` or `@hasField`) over version checks.5058 \\/// feature detection (i.e. with `@hasDecl` or `@hasField`) over version checks.
5059 \\pub const zig_version = std.SemanticVersion.parse("{s}") catch unreachable;5059 \\pub const zig_version = std.SemanticVersion.parse(zig_version_string) catch unreachable;
5060 \\pub const zig_version_string = "{s}";
5060 \\pub const zig_backend = std.builtin.CompilerBackend.{};5061 \\pub const zig_backend = std.builtin.CompilerBackend.{};
5061 \\5062 \\
5062 \\pub const output_mode = std.builtin.OutputMode.{};5063 \\pub const output_mode = std.builtin.OutputMode.{};