Fix odin version printing

This commit is contained in:
Ginger Bill
2017-06-29 16:08:30 +01:00
parent e4a8283327
commit 7e3293fc20
3 changed files with 5 additions and 4 deletions

View File

@@ -1166,7 +1166,7 @@ Type *check_get_params(Checker *c, Scope *scope, AstNode *_params, bool *is_vari
success = false;
}
} else {
type = make_type_generic(c->allocator, 0);
type = make_type_generic(c->allocator, 0, str_lit(""));
}
} else {
type = check_type(c, type_expr);

View File

@@ -375,7 +375,7 @@ int main(int arg_count, char **arg_ptr) {
return 1;
#endif
} else if (args[1] == "version") {
gb_printf("%s version %.*s\n", args[0], LIT(build_context.ODIN_VERSION));
gb_printf("%.*s version %.*s\n", LIT(args[0]), LIT(build_context.ODIN_VERSION));
return 0;
} else {
usage(args[0]);

View File

@@ -117,7 +117,7 @@ struct TypeRecord {
#define TYPE_KINDS \
TYPE_KIND(Basic, BasicType) \
TYPE_KIND(Generic, struct{ i64 id; }) \
TYPE_KIND(Generic, struct{ i64 id; String name; }) \
TYPE_KIND(Pointer, struct { Type *elem; }) \
TYPE_KIND(Atomic, struct { Type *elem; }) \
TYPE_KIND(Array, struct { Type *elem; i64 count; }) \
@@ -478,9 +478,10 @@ Type *make_type_basic(gbAllocator a, BasicType basic) {
return t;
}
Type *make_type_generic(gbAllocator a, i64 id) {
Type *make_type_generic(gbAllocator a, i64 id, String name) {
Type *t = alloc_type(a, Type_Generic);
t->Generic.id = id;
t->Generic.name = name;
return t;
}