From: MegaMole <yor...@fr...> - 2002-12-09 13:39:19
|
This might not belong to this forum... I'd like to port a large project (ZDoom) to mingw-2.0, thought it would be easy because it already builds with gcc 3.0 on Linux and with MS VC on win32. But I cannot compile some ugly pointer (offsetting into a class) pieces. Looked at the (Linux) gcc3.0 makefile but didn't find any switch or option explaining why gcc3.0 eats this code and why the mingw gcc3.2 does not. class whatever { public: DArgs *getspawned; AActor *CorpseQueue[64]; ... } Original pointer declaration: (size_t)&((ThisClass *)0)->getspawned; produces invalid offsetof from non-POD... use pointers to members instead warning, so I changed it to (size_t)&ThisClass::getspawned; and it compiles fine. But with the second member I got stuck: the original code is as before: (size_t)&((ThisClass *)0)->CorpseQueue[0]; (size_t)&((ThisClass *)0)->CorpseQueue[1]; ... will not compile, nor my attempt with the trick above: (size_t)&ThisClass::CorpseQueue[0]; complaining member not declared as static. What am I doing wrong? thanks, rpeter |