This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: About -fms-abi patch


> When the patches that I published (about the option -fms-abi) will they be
> included in the project?

Antonio,

I can't give an authorative answer, but I have two comments:

- You did sign the copyright assignment, right? Otherwise, no code is
  accepted.

- As far as I recall, this patch changes the vtable layout for all classes,
  so they work as COM interface implementations (correct me if I'm wrong).
  This might also be a prerequisite for linking MFC etc, but I'm sure there
  are other issues such as members layout that would prevent linking MSVC
  generated libraries.

Thinking about this, I found that one might rather select the COM
compatibility on a per-class basis, so that classes not used as
ActiveX objects still enjoy the richer functionality (i.e. rtti,
correct exception handling, etc.)

So I'd propose an alternative where you give a class an attribute:

class __attribute__((comobject)) IUnknown{
 //...
};

A class attributed that way will have COM compliant layout (i.e. the
vtable will just contain the proper stdcall methods). This attribute
is inherited to derived classes, so that you effectively only need to
modify IUnknown.

What do you think?

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]