I'm looking into porting a script engine written for Windows to Linux; it's for Winamp's visualization platform AVS. I'm not sure if it's even possible at the moment. From what I can tell the code is taking the addresses of the C functions nseel_asm_atan
and nseel_asm_atan_end
and storing them inside a table that it can reference during code execution.
I've looked at MS's documentation, but I'm unsure what __declspec(naked)
really does. What is prolog and epilog code mentioned in the documentation? Is that related to Windows calling conventions? Is this portable? Know of any Linux-based examples using similar techniques?
static double (*__atan)(double) = &atan;
__declspec ( naked ) void nseel_asm_atan(void)
{
FUNC1_ENTER
*__nextBlock = __atan(*parm_a);
FUNC_LEAVE
}
__declspec ( naked ) void nseel_asm_atan_end(void) {}
#define __declspec(n)
to expand to nothing for Linux. I think GNU C++ implements something similar, but I'm not quite sure what it is off the top of my head. – Fragmental