// Original file is iob_shim.asm // Rewritten in C because the build system breaks on linux-windows crosscomp with this // rm: __declspec(naked) is seemingly(?) not working on x86_64 (atleast via wine); use __attribute__((naked)) instead. #if 0 .code EXTRN __acrt_iob_func:PROC __iob_func PROC mov ecx, 0 jmp __acrt_iob_func __iob_func ENDP END #endif #include extern "C" FILE* __cdecl __acrt_iob_func(unsigned index); extern "C" __attribute__((naked)) FILE* __cdecl __iob_func(void) { __asm__( "xorl %ecx, %ecx\n\t" "jmp __acrt_iob_func" ); }