Fix overloading bug due to #import .; Add sys/wgl.odin

This commit is contained in:
Ginger Bill
2017-02-19 11:35:33 +00:00
parent 0c37aa9ea0
commit 758dd9ba16
7 changed files with 114 additions and 43 deletions
+14
View File
@@ -1715,6 +1715,12 @@ void check_import_entities(Checker *c, MapScope *file_scopes) {
continue;
}
if (id->is_import) {
// String gpa = str_lit("GetProcAddress");
// if (str_eq(e->token.string, gpa)) {
// Entity *f = scope_lookup_entity(parent_scope, gpa);
// gb_printf_err("%.*s %.*s %td\n", LIT(gpa), LIT(f->token.pos.file), entity_procedure_overload_count(f));
// }
if (is_entity_exported(e)) {
// TODO(bill): Should these entities be imported but cause an error when used?
bool ok = add_entity(c, parent_scope, NULL, e);
@@ -1722,6 +1728,12 @@ void check_import_entities(Checker *c, MapScope *file_scopes) {
map_bool_set(&parent_scope->implicit, hash_pointer(e), true);
}
}
// if (str_eq(e->token.string, gpa)) {
// Entity *f = scope_lookup_entity(parent_scope, gpa);
// gb_printf_err("%.*s %.*s %td\n", LIT(gpa), LIT(f->token.pos.file), entity_procedure_overload_count(f));
// }
} else {
add_entity(c, parent_scope, NULL, e);
}
@@ -1736,6 +1748,8 @@ void check_import_entities(Checker *c, MapScope *file_scopes) {
Entity *e = make_entity_import_name(c->allocator, parent_scope, id->import_name, t_invalid,
id->fullpath, id->import_name.string,
scope);
add_entity(c, parent_scope, NULL, e);
}
}