After trying to replace the offset keyword with __offsetof while trying to compile with Apple GCC 4.2.1 using the -fasm-blocks argument (which enables Intel style assembly syntax) inline assembly code which worked in MSVC, I get an error: Cannot apply offsetof to member function MyClass::MyFunction
class MyClass
{
void MyFunction(void* pData)
{
}
};
void test()
{
_asm
{
//mov eax, offset MyClass::MyFunction - this works in MSVC
mov eax, offsetof(class MyClass, MyFunction) //error: Cannot apply offsetof to member function MyClass::MyFunction
mov eax, __offsetof(class MyClass, MyFunction) //error: Invalid cast from type 'void (MyClass::*)(void*)' to type size_t
};
}
Can somebody please tell me, what should I do? It seems that the whole structure of the application I'm porting is based on this damn offset macro...