Windows xpcomglue link errors [solved]

"[email protected]" <[email protected]> Sat, 03 Sep 2011 16:07:06 +0100
Newsgroups gmane.comp.mozilla.devel.embedding
Organization NovaDSP
Message-ID <[email protected]>
Apologies if this gets double-posted

Examining the contents of xpcomglue.lib (using dumpbin /symbols ) I get 
the following

lInker: public: virtual unsigned int __thiscall 
nsCreateInstanceByContractID::operator()(struct nsID const &,void * *)const
lib: public: virtual unsigned int __fastcall 
nsCreateInstanceByContractID::operator()(struct nsID const &,void * *)const

The calling conventions are different for the 'missing' functions, they 
are all marked as __fastcall when the library is built but somehow have 
a different calling convention applied...

once name mangling process is applied we get:

??RnsCreateInstanceByContractID@@UBEIABUnsID@@PAPAX@Z
??RnsCreateInstanceByContractID@@UBIIABUnsID@@PAPAX@Z

The cause is simple. In xpcom\base\nscore.h we have:

#elif defined(XP_WIN) && !defined(_WIN64)
#define NS_FASTCALL __fastcall
#define NS_CONSTRUCTOR_FASTCALL
...

Why is this defined only when XP_WIN is defined? A bug?

Thx

J.