Interfacing with XPCOM

John Reimer terminal.node at gmail.com
Sun Nov 30 17:56:04 PST 2008


Hello Walter,

> So are you saying that XPCOM will work on Linux with D if only the
> extern(Windows) was actually extern(C++) ?
> 


Yes, I think so.  But I should probably test the theory with dmd 2.0 first 
just to make sure.  This is just about over my head since I'm not too familiar 
with C++ internals.  In terms of XPCOM, I believe that when an interface 
is assigned an implementation pointer and the interface method is called, 
the most important detail is that the /parameter/ signature at a specific 
vtable index match that of the implementation's at the same index:  that 
is, the method names are not important except as an alias for client to use; 
it is assumed that the interface methods will match the calling convention 
and argument types of the implementation which was assigned to it).

So my question would be, in terms /calling conventions/ in an /interface/ 
(not a class), does extern(System)  differ in any way from extern(C++).  
Does a "this" pointer get prepended to the argument list of a C++ method 
call?  I apologize if this is an ignorant question.  I'm almost clueless 
here.  I'm assuming that the only difference in the extern(C++) is that it:

(1) changes the interface to have a "normal" vtable (as XPCOM needs) and 

(2) allows for a system calling convention (method name not being important 
other than that the parameters of interface and implementation match).

-JJR





More information about the Digitalmars-d mailing list