From: Roman W. <rom...@gm...> - 2011-06-21 08:39:42
|
> If it's a C++ header file then probably it is subject to all kinds of > undocumented grey areas in the standard, I find many header directives making things compatible. Like: "#pragma pack(push,1)" __stdcall "extern C", abstract C++ classes (only pure virtuals methods) > which means that future versions > of Visual Studio might well be incompatible with it, as well as all other > C++ compilers (MinGW, Watcom, Borland...) I do not believe Microsoft guys would make things incompatible to them self, they used to follow their own history. I feel the spirit of MinGW and gcc-cross-compilation is to give an alternative, so they probably will not remove to much of compatibility. > Is it possible for you to give the overloaded methods unique names to work > around this? (so that they're no longer overloaded) Yes: class Vtable { #ifdef __GNU__ virtual void Overloaded(Vtable&) = 0; virtual void Overloaded(int) = 0; #elif _MSC_VER //microsoft compiler virtual void Overloaded(int) = 0; virtual void Overloaded(Vtable&) = 0; #endif virtual void Other() = 0; }; generates same virtual tables as class Vtable { //order used by gcc virtual void Overloaded1(Vtable&) = 0; virtual void Overloaded2(int) = 0; virtual void Other() = 0; }; for both MinGw and visual studio express Thank you much, it makes things simpler and generaly works for "preprocessor macro" i was looking for. Even if it works only due to grey areas of vtable generation. |