intern_print_type_pre(type->return_type, false);
+ switch (type->calling_convention) {
+ case CC_CDECL:
+ fputs(" __cdecl ", out);
+ break;
+ case CC_STDCALL:
+ fputs(" __stdcall ", out);
+ break;
+ case CC_FASTCALL:
+ fputs(" __fastcall ", out);
+ break;
+ case CC_THISCALL:
+ fputs(" __thiscall ", out);
+ break;
+ case CC_DEFAULT:
+ break;
+ }
+
/* don't emit braces if we're the toplevel type... */
if (!top)
fputc('(', out);
const scope_t *scope, bool top)
{
intern_print_type_post(type->return_type, false);
- /* don't emit braces if we're the toplevel type... */
- if (!top)
- fputc(')', out);
fputc('(', out);
-
bool first = true;
if (scope == NULL) {
function_parameter_t *parameter = type->parameters;
fputs("void", out);
}
fputc(')', out);
+
+ /* don't emit braces if we're the toplevel type... */
+ if (!top)
+ fputc(')', out);
}
/**
switch(type->kind) {
case TYPE_ERROR:
fputs("<error>", out);
+ return;
case TYPE_INVALID:
fputs("<invalid>", out);
return;
return test_atomic_type_flag(type->atomic.akind, ATOMIC_TYPE_FLAG_INTEGER);
}
+/**
+ * Returns true if the given type is an enum type.
+ *
+ * @param type The type to check.
+ * @return True if type is an enum type.
+ */
+bool is_type_enum(const type_t *type)
+{
+ assert(!is_typeref(type));
+ return type->kind == TYPE_ENUM;
+}
+
/**
* Returns true if the given type is an floating point type.
*
}
}
+/**
+ * Returns true if the given type is an integer or float type.
+ *
+ * @param type The type to check.
+ * @return True if type is an integer or float type.
+ */
bool is_type_real(const type_t *type)
{
/* 6.2.5.17 */
if (func1->variadic != func2->variadic)
return false;
+ if (func1->calling_convention != func2->calling_convention)
+ return false;
+
/* TODO: handling of unspecified parameters not correct yet */
/* all argument types must be compatible */