authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-19 21:51:24-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-19 21:51:24-05:00
logef2d237f2fbcca0f16b307dda01287e78363627a
tree367af60484b4e4033fe5e2debf02ebf2653a10ea
parent84f1893c18c4ef12dbe268ed6d11a11966a9d447
signaturelock-open Commit is signed but in an unrecognized format.

this is not the proper way to support this feature


1 files changed, 0 insertions(+), 8 deletions(-)

lib/std/target.zig-8
...@@ -49,8 +49,6 @@ pub const Target = union(enum) {...@@ -49,8 +49,6 @@ pub const Target = union(enum) {
49 other,49 other,
5050
51 pub fn parse(text: []const u8) !Os {51 pub fn parse(text: []const u8) !Os {
52 if (mem.eql(u8, text, "native")) return builtin.os;
53
54 const info = @typeInfo(Os);52 const info = @typeInfo(Os);
55 inline for (info.Enum.fields) |field| {53 inline for (info.Enum.fields) |field| {
56 if (mem.eql(u8, text, field.name)) {54 if (mem.eql(u8, text, field.name)) {
...@@ -152,8 +150,6 @@ pub const Target = union(enum) {...@@ -152,8 +150,6 @@ pub const Target = union(enum) {
152 }150 }
153151
154 pub fn parse(text: []const u8) !Abi {152 pub fn parse(text: []const u8) !Abi {
155 if (mem.eql(u8, text, "native")) return builtin.abi;
156
157 const info = @typeInfo(Abi);153 const info = @typeInfo(Abi);
158 inline for (info.Enum.fields) |field| {154 inline for (info.Enum.fields) |field| {
159 if (mem.eql(u8, text, field.name)) {155 if (mem.eql(u8, text, field.name)) {
...@@ -582,8 +578,6 @@ pub const Target = union(enum) {...@@ -582,8 +578,6 @@ pub const Target = union(enum) {
582 }578 }
583579
584 pub fn parse(text: []const u8) !Arch {580 pub fn parse(text: []const u8) !Arch {
585 if (mem.eql(u8, text, "native")) return builtin.arch;
586
587 const info = @typeInfo(Arch);581 const info = @typeInfo(Arch);
588 inline for (info.Enum.fields) |field| {582 inline for (info.Enum.fields) |field| {
589 if (mem.eql(u8, text, field.name)) {583 if (mem.eql(u8, text, field.name)) {
...@@ -727,14 +721,12 @@ pub const Target = union(enum) {...@@ -727,14 +721,12 @@ pub const Target = union(enum) {
727 /// * CPU Architecture721 /// * CPU Architecture
728 /// * Operating System722 /// * Operating System
729 /// * C ABI (optional)723 /// * C ABI (optional)
730 /// "native" can be used for any of the fields.
731 arch_os_abi: []const u8,724 arch_os_abi: []const u8,
732725
733 /// Looks like "name+a+b-c-d+e", where "name" is a CPU Model name, "a", "b", and "e"726 /// Looks like "name+a+b-c-d+e", where "name" is a CPU Model name, "a", "b", and "e"
734 /// are examples of CPU features to add to the set, and "c" and "d" are examples of CPU features727 /// are examples of CPU features to add to the set, and "c" and "d" are examples of CPU features
735 /// to remove from the set.728 /// to remove from the set.
736 /// The default value of `null` means to use the "baseline" feature set.729 /// The default value of `null` means to use the "baseline" feature set.
737 /// "native" can be used to perform CPU introspection.
738 cpu: ?[]const u8 = null,730 cpu: ?[]const u8 = null,
739 };731 };
740732