int param_unsigneds[128];
int param_floatings[128];
+ int import_call_stack_bytes;
int is_implicit;
int extern_emitted;
}
+ global_symbols[i].import_call_stack_bytes = 0;
global_symbols[i].param_count = 0;
global_symbols[i].has_prototype = 0;
global_symbols[i].is_variadic = 0;
}
+ if (bytes <= 0 && global_symbols[i].import_call_stack_bytes > 0) {
+ bytes = global_symbols[i].import_call_stack_bytes;
+ }
+
return bytes;
}
+static void remember_global_symbol_import_call_stack_bytes (const char *name, int bytes) {
+
+ int i = find_global_symbol (name);
+
+ if (i < 0 || bytes <= 0) {
+ return;
+ }
+
+ if (global_symbols[i].kind != GLOBAL_SYMBOL_FUNCTION || !global_symbols[i].is_dllimport || global_symbols[i].calling_convention != TOK_STDCALL) {
+ return;
+ }
+
+ if (global_symbol_stdcall_stack_bytes (name) <= 0) {
+ global_symbols[i].import_call_stack_bytes = bytes;
+ }
+
+}
+
static const char *asm_global_symbol_name (const char *name) {
static char buffers[8][512];
}
+ global_symbols[global_symbol_count].import_call_stack_bytes = 0;
global_symbols[global_symbol_count].param_count = 0;
global_symbols[global_symbol_count].has_prototype = 0;
global_symbols[global_symbol_count].is_variadic = 0;
parsed_type_is_void = 0;
parsed_type_only_qualifiers = 0;
parsed_type_size = DATA_NONE;
+
parsed_calling_convention = TOK_EOF;
+
+ if (declarator_depth == 0) {
+ declarator_calling_convention = TOK_EOF;
+ }
+
parsed_dllexport = 0;
parsed_dllimport = 0;
fprintf (state->ofp, " call ecx\n");
} else if (get_global_symbol_dllimport (name)) {
+
+ remember_global_symbol_import_call_stack_bytes (name, total_arg_bytes);
fprintf (state->ofp, (state->syntax & ASM_SYNTAX_NASM ? " call dword [%s]\n" : " call dword ptr %s\n"), asm_global_import_symbol_name (name));
+
} else {
fprintf (state->ofp, " call %s\n", asm_name);
}
fprintf (state->ofp, " call *%%ecx\n");
} else if (get_global_symbol_dllimport (name)) {
+
+ remember_global_symbol_import_call_stack_bytes (name, total_arg_bytes);
fprintf (state->ofp, " call *%s\n", asm_global_import_symbol_name (name));
+
} else {
fprintf (state->ofp, " call %s\n", asm_name);
}