回答

1

试试这个:

#define foo(x,output,ctx) {\ 
    __asm mov eax, 0xCAFEBEE1 \ 
    __asm add eax, 5\ 
} 
1

只要你有预处理器的问题,一定要使用Project + Properties,C/C++,Preprocessor,Preprocess to file = Yes。构建,你会在构建目录中找到一个.i文件。其中显示在您的片段上:

int wmain(int argc, _TCHAR* argv[]) 
{ 
    { __asm { mov eax, 0xCAFEBEE1 add eax, 5 }}; 
    return 0; 
} 

现在很明显,宏行上没有行尾。在预处理器上诅咒一点让你感觉更好。然后每行修复一个__asm。