aboutsummaryrefslogtreecommitdiff
path: root/std/build.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-05-17 12:26:35 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-05-17 12:26:35 -0400
commitb483db486842c6d7d348b28ca09e56673e1bd800 (patch)
tree72c392366154f45f0c657bd7650d65d9f7d9e86d /std/build.zig
parent9851a943ed0360433c9612449ed065a6800adc51 (diff)
downloadzig-b483db486842c6d7d348b28ca09e56673e1bd800.tar.gz
zig-b483db486842c6d7d348b28ca09e56673e1bd800.zip
typeId builtin instead of isInteger, isFloat, etc
closes #373
Diffstat (limited to 'std/build.zig')
-rw-r--r--std/build.zig18
1 files changed, 9 insertions, 9 deletions
diff --git a/std/build.zig b/std/build.zig
index f944133d5b..29837b4ba4 100644
--- a/std/build.zig
+++ b/std/build.zig
@@ -488,15 +488,15 @@ pub const Builder = struct {
}
fn typeToEnum(comptime T: type) -> TypeId {
- if (@isInteger(T)) {
- TypeId.Int
- } else if (@isFloat(T)) {
- TypeId.Float
- } else switch (T) {
- bool => TypeId.Bool,
- []const u8 => TypeId.String,
- []const []const u8 => TypeId.List,
- else => @compileError("Unsupported type: " ++ @typeName(T)),
+ switch (@typeId(T)) {
+ builtin.TypeId.Int => TypeId.Int,
+ builtin.TypeId.Float => TypeId.Float,
+ builtin.TypeId.Bool => TypeId.Bool,
+ else => switch (T) {
+ []const u8 => TypeId.String,
+ []const []const u8 => TypeId.List,
+ else => @compileError("Unsupported type: " ++ @typeName(T)),
+ },
}
}