-/* returns a mangled name for a Win32 function using it's calling convention */
-ident *decorate_win32_c_fkt(ir_entity *ent, ident *id) {
- ir_type *tp = get_entity_type(ent);
- unsigned cc_mask = get_method_calling_convention(tp);
- char buf[16];
- int size, i;
-
- if (IS_CDECL(cc_mask))
- return mangle3("_", id, "");
- else if (IS_STDCALL(cc_mask)) {
- size = 0;
- for (i = get_method_n_params(tp) - 1; i >= 0; --i) {
- size += get_type_size_bytes(get_method_param_type(tp, i));
- }
-
- snprintf(buf, sizeof(buf), "@%d", size);
-
- if (cc_mask & cc_reg_param)
- return mangle3("@", id, buf);
- else
- return mangle3("_", id, buf);
- }
- return id;