widl: Support non-default calling conventions for object methods.

This commit is contained in:
Rob Shearman 2008-04-11 11:01:36 +01:00 committed by Alexandre Julliard
parent fe7e786ace
commit 5483ea9e87
2 changed files with 12 additions and 4 deletions

View file

@ -729,10 +729,12 @@ static void write_cpp_method_def(const type_t *iface)
{
var_t *def = cur->def;
if (!is_callas(def->attrs)) {
const char *callconv = get_attrp(def->type->attrs, ATTR_CALLCONV);
if (!callconv) callconv = "";
indent(header, 0);
fprintf(header, "virtual ");
write_type_decl_left(header, get_func_return_type(cur));
fprintf(header, " STDMETHODCALLTYPE ");
fprintf(header, " %s ", callconv);
write_name(header, def);
fprintf(header, "(\n");
write_args(header, cur->args, iface->name, 2, TRUE);
@ -755,9 +757,11 @@ static void do_write_c_method_def(const type_t *iface, const char *name)
{
const var_t *def = cur->def;
if (!is_callas(def->attrs)) {
const char *callconv = get_attrp(def->type->attrs, ATTR_CALLCONV);
if (!callconv) callconv = "";
indent(header, 0);
write_type_decl_left(header, get_func_return_type(cur));
fprintf(header, " (STDMETHODCALLTYPE *");
fprintf(header, " (%s *", callconv);
write_name(header, def);
fprintf(header, ")(\n");
write_args(header, cur->args, name, 1, TRUE);
@ -787,9 +791,11 @@ static void write_method_proto(const type_t *iface)
const var_t *def = cur->def;
if (!is_local(def->attrs)) {
const char *callconv = get_attrp(def->type->attrs, ATTR_CALLCONV);
if (!callconv) callconv = "";
/* proxy prototype */
write_type_decl_left(header, get_func_return_type(cur));
fprintf(header, " CALLBACK %s_", iface->name);
fprintf(header, " %s %s_", callconv, iface->name);
write_name(header, def);
fprintf(header, "_Proxy(\n");
write_args(header, cur->args, iface->name, 1, TRUE);

View file

@ -253,10 +253,12 @@ static void gen_proxy(type_t *iface, const func_t *cur, int idx,
var_t *def = cur->def;
int has_ret = !is_void(get_func_return_type(cur));
int has_full_pointer = is_full_pointer_function(cur);
const char *callconv = get_attrp(def->type->attrs, ATTR_CALLCONV);
if (!callconv) callconv = "";
indent = 0;
write_type_decl_left(proxy, get_func_return_type(cur));
print_proxy( " STDMETHODCALLTYPE %s_", iface->name);
print_proxy( " %s %s_", callconv, iface->name);
write_name(proxy, def);
print_proxy( "_Proxy(\n");
write_args(proxy, cur->args, iface->name, 1, TRUE);