diff options
| author | gingerBill <bill@gingerbill.org> | 2017-10-30 20:26:05 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2017-10-30 20:26:05 +0000 |
| commit | 414486829a539095062c3c035df729c11f7f4235 (patch) | |
| tree | c1c8cc403a26b07bb34812a07a1d9b2fde72c6bf /src/check_type.cpp | |
| parent | 3e05be8eb8b14729b63ee541d11b3deb19b38710 (diff) | |
Add string_set.cpp; Code clean up
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index 5d3382f47..b2536e685 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -1890,7 +1890,7 @@ bool check_procedure_type(Checker *c, Type *type, AstNode *proc_type_node, Array ProcCallingConvention cc = pt->calling_convention; if (cc == ProcCC_ForeignBlockDefault) { - cc = ProcCC_C; + cc = ProcCC_CDecl; if (c->context.default_foreign_cc > 0) { cc = c->context.default_foreign_cc; } @@ -1911,14 +1911,10 @@ bool check_procedure_type(Checker *c, Type *type, AstNode *proc_type_node, Array if (param_count > 0) { Entity *end = params->Tuple.variables[param_count-1]; if (end->flags&EntityFlag_CVarArg) { - if (cc == ProcCC_Odin) { - error(end->token, "Odin calling convention does not support #c_vararg"); - } else if (cc == ProcCC_Contextless) { - error(end->token, "Odin's contextless calling convention does not support #c_vararg"); - } else if (cc == ProcCC_Fast) { - error(end->token, "Fast calling convention does not support #c_vararg"); - } else { + if (cc == ProcCC_StdCall || cc == ProcCC_CDecl) { type->Proc.c_vararg = true; + } else { + error(end->token, "Calling convention does not support #c_vararg"); } } } |