Hello Walter,

John Reimer wrote:

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).

The system linkage was devised to match the Microsoft "syscall"
convention. It really has no meaning on linux, so we can make it
whatever it needs to be.

The C++ convention is designed to match whatever C++ does on the
target platform. Since Linux doesn't have any Windows or System
calling convention, it would seem that C++ is the one.



So extern(System) does not translate to extern(C)? Does that mean that all extern(System)'s in my code are defaulting to extern(D)?

That'd be a shocker to me. :) If that's true, it would certainly change my understanding of what I thought was making my code work. :D

-JJR


Reply via email to