From 67daf2fe0ab3418be3b5c39321eff7983fe20180 Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Tue, 4 Jan 2011 14:18:50 +0300 Subject: [PATCH] Fix for variadic functions --- gen/functions.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gen/functions.cpp b/gen/functions.cpp index eaa4e25a..9684fbc5 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -117,6 +117,12 @@ const llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nest lidx++; } } +#if DMDV2 + else + { + fty.c_vararg = true; + } +#else else if (f->linkage == LINKc) { fty.c_vararg = true; @@ -126,6 +132,7 @@ const llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nest type->error(0, "invalid linkage for variadic function"); fatal(); } +#endif } // if this _Dmain() doesn't have an argument, we force it to have one