From 414486829a539095062c3c035df729c11f7f4235 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 30 Oct 2017 20:26:05 +0000 Subject: Add string_set.cpp; Code clean up --- src/check_type.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/check_type.cpp') 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"); } } } -- cgit v1.2.3