- /* C functions cannot currently have __fastcall__ calling conventions */
- if (IsFastCallFunc (Func->Type)) {
- Error ("__fastcall__ is not allowed for C functions");
+ /* Declare two special functions symbols: __fixargs__ and __argsize__.
+ * The latter is different depending on the type of the function (variadic
+ * or not).
+ */
+ AddConstSym ("__fixargs__", type_uint, SC_DEF | SC_CONST, D->ParamSize);
+ if (D->Flags & FD_VARIADIC) {
+ /* Variadic function. The variable must be const. */
+ static const type T [] = { T_UCHAR | T_QUAL_CONST, T_END };
+ AddLocalSym ("__argsize__", T, SC_DEF | SC_REF | SC_AUTO, 0);
+ } else {
+ /* Non variadic */
+ AddConstSym ("__argsize__", type_uchar, SC_DEF | SC_CONST, D->ParamSize);