aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-05-27 11:03:46 +0100
committergingerBill <bill@gingerbill.org>2018-05-27 11:03:46 +0100
commit6aae381e83dddf8808feefe4a5a2470320f27342 (patch)
tree4b83602375cb42f89d68c89c60bd1389df93369a /src/check_decl.cpp
parent7ee9051a56ca0c04e6b60f53b9dfe47c75596496 (diff)
Move ODIN_* platform constants to `core:os`
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index db666da46..f4545e794 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -534,12 +534,7 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) {
e->deprecated_message = ac.deprecated_message;
ac.link_name = handle_link_name(c, e->token, ac.link_name, ac.link_prefix);
- AstPackage *package = nullptr;
- if (d->scope->parent && d->scope->parent->is_package) {
- package = d->scope->parent->package;
- }
-
- if (package != nullptr && e->token.string == "main") {
+ if (e->package != nullptr && e->token.string == "main") {
if (pt->param_count != 0 ||
pt->result_count != 0) {
gbString str = type_to_string(proc_type);
@@ -551,7 +546,7 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) {
error(e->token, "Procedure 'main' cannot have a custom calling convention");
}
pt->calling_convention = ProcCC_Contextless;
- if (package->kind == ImportedPackage_Init) {
+ if (e->package->kind == ImportedPackage_Init) {
if (c->info.entry_point != nullptr) {
error(e->token, "Redeclaration of the entry pointer procedure 'main'");
} else {