Original Post
Branching from my other thread on the offsetof() macro: http://www.gamedev.net/community/forums/topic.asp?topic_id=260145 I have the following class: Since the class has a constructor MSVC will return objects of this type by reference by having the caller allocate memory for it and pass the pointer to the memory in a hidden address. MSVC will do this for all classes that have either a constructor, a destructor or an assignment operator. My problem is that this is not true for MinGW. For this example it seems that MinGW returns the object normally in the register EAX. I write in AngelScript's manual that you should use the flag asOBJ_IS_COMPLEX when registering a class that has a constructor, destructor, or assignment operator. AngelScript is supposed to use this flag to identify the correct method that the host application uses to return objects with that type. I need help in defining how MinGW returns objects on the x86 processor. If you don't know exactly how it is done already, then perhaps you can tell me how I can debug the MinGW code or disassemble it.
class CComplexClass
{
public:
CComplexClass() { a = 0xDEADC0DE; }
unsigned long a;
};