--- /dev/null
+#!/bin/sh -x
+set -e
+
+f=/tmp/sedcmd_
+echo -n "sed -i '\
+s:__cdecl: /* __cdecl*/:;\
+s:__stdcall: /*__stdcall*/:;\
+s:__usercall: /*__usercall*/:;\
+s:__userpurge: /* __userpurge*/:;\
+s:__thiscall: /* __thiscall*/:;\
+s:__fastcall: /*__fastcall*/:;\
+s:\(<[^>]*>\):/*\1*/:g;\
+' $1" > $f
+. $f
+
must_save |= is_x86_reg_saved(reg_list[i]);
}
- fprintf(f, ".global _asm_%s\n", sym);
- fprintf(f, "_asm_%s:\n", sym);
+ fprintf(f, ".global _%s\n", sym);
+ fprintf(f, "_%s:\n", sym);
if (!have_regs && !is_stdcall) {
fprintf(f, "\tjmp %s\n\n", sym);
fprintf(f, "\tcall %s\n\n", sym);
if (args_repushed && !is_stdcall)
- fprintf(f, "\tadd %d,%%esp\n", args_repushed * 4);
+ fprintf(f, "\tadd $%d,%%esp\n", args_repushed * 4);
// restore regs
for (i = reg_cnt - 1; i >= 0; i--) {
fprintf(f, "\n\tcall _%s\n\n", sym);
if (sarg_ofs > 2)
- fprintf(f, "\tadd %d,%%esp\n", (sarg_ofs - 2) * 4);
+ fprintf(f, "\tadd $%d,%%esp\n", (sarg_ofs - 2) * 4);
fprintf(f, "\tpopl %%edx\n");