I'm working on an old MUD codebase with a friend just as a hobby project, but I'm having issues getting the code to compile in any OS other than debian (x386 specifically). The issue is (mostly) because of a few asm lines that I honestly don't understand enough to modify. The error I receive when trying to compile in VS is "error c2059: syntax error '' line 29. Any idea on how to get this to compile on an x64 OS?
void Execute(int nArgs, ...)
{
if(MAX_FUNCTION_ARGS < nArgs)
throw "Error: CFuncPtr has too many args";
int i;
void *fptrs[MAX_FUNCTION_ARGS], *ptrs[MAX_FUNCTION_ARGS];
va_list ap;
va_start(ap, nArgs);
for(i = 0; i < nArgs; i++)
fptrs[i] = va_arg(ap, void *);
for(i = 0; i < nArgs; i++)
{
ptrs[i] = fptrs[nArgs - i - 1];
// ============== This is the part with the issue
asm volatile("" \ // This is line 29.
"movl %0, %%eax\n\t" \
"pushl %%eax\n\t" \
:
: "r"(ptrs[i])
: "%eax");
// ==============
}
(*funcptr) ();
va_end(ap);
}