mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
Build.Step.Options: add comptime_float support
It seems to me this was simply forgotten. Or there is some reason I don't know why this code doesn't work for `comptime_float`. For a more comprehensive fix, https://github.com/ziglang/zig/pull/24057 is the place to look.
This commit is contained in:
parent
f3270ceca4
commit
e23af9d31d
1 changed files with 3 additions and 0 deletions
|
|
@ -230,6 +230,7 @@ fn printType(
|
||||||
.int,
|
.int,
|
||||||
.comptime_int,
|
.comptime_int,
|
||||||
.float,
|
.float,
|
||||||
|
.comptime_float,
|
||||||
.null,
|
.null,
|
||||||
=> {
|
=> {
|
||||||
if (name) |some| {
|
if (name) |some| {
|
||||||
|
|
@ -594,6 +595,7 @@ test Options {
|
||||||
options.addOption(?usize, "option2", null);
|
options.addOption(?usize, "option2", null);
|
||||||
options.addOption(?usize, "option3", 3);
|
options.addOption(?usize, "option3", 3);
|
||||||
options.addOption(comptime_int, "option4", 4);
|
options.addOption(comptime_int, "option4", 4);
|
||||||
|
options.addOption(comptime_float, "option5", 5.01);
|
||||||
options.addOption([]const u8, "string", "zigisthebest");
|
options.addOption([]const u8, "string", "zigisthebest");
|
||||||
options.addOption(?[]const u8, "optional_string", null);
|
options.addOption(?[]const u8, "optional_string", null);
|
||||||
options.addOption([2][2]u16, "nested_array", nested_array);
|
options.addOption([2][2]u16, "nested_array", nested_array);
|
||||||
|
|
@ -618,6 +620,7 @@ test Options {
|
||||||
\\pub const option2: ?usize = null;
|
\\pub const option2: ?usize = null;
|
||||||
\\pub const option3: ?usize = 3;
|
\\pub const option3: ?usize = 3;
|
||||||
\\pub const option4: comptime_int = 4;
|
\\pub const option4: comptime_int = 4;
|
||||||
|
\\pub const option5: comptime_float = 5.01;
|
||||||
\\pub const string: []const u8 = "zigisthebest";
|
\\pub const string: []const u8 = "zigisthebest";
|
||||||
\\pub const optional_string: ?[]const u8 = null;
|
\\pub const optional_string: ?[]const u8 = null;
|
||||||
\\pub const nested_array: [2][2]u16 = [2][2]u16 {
|
\\pub const nested_array: [2][2]u16 = [2][2]u16 {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue