mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-20 11:30:34 +00:00
Make main calling convention "odin" rather than "contextless" to simplify code generation
This commit is contained in:
@@ -743,11 +743,10 @@ void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) {
|
||||
error(e->token, "Procedure type of 'main' was expected to be 'proc()', got %s", str);
|
||||
gb_string_free(str);
|
||||
}
|
||||
if (pt->calling_convention != ProcCC_Odin &&
|
||||
pt->calling_convention != ProcCC_Contextless) {
|
||||
if (pt->calling_convention != ProcCC_Odin) {
|
||||
error(e->token, "Procedure 'main' cannot have a custom calling convention");
|
||||
}
|
||||
pt->calling_convention = ProcCC_Contextless;
|
||||
pt->calling_convention = ProcCC_Odin;
|
||||
if (e->pkg->kind == Package_Init) {
|
||||
if (ctx->info->entry_point != nullptr) {
|
||||
error(e->token, "Redeclaration of the entry pointer procedure 'main'");
|
||||
|
||||
Reference in New Issue
Block a user