This is the mail archive of the
mailing list for the GCC project.
Re: Patch to fix support of C++ dllimports
- To: Jason Merrill <jason at cygnus dot com>
- Subject: Re: Patch to fix support of C++ dllimports
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Sun, 16 Aug 1998 00:04:01 -0500
- Cc: egcs-patches at cygnus dot com
Jason Merrill <firstname.lastname@example.org> writes:
> > Jason, any side effect of peeking into TREE_TYPE(enclosing_type)?
> No, but that's relying on an implementation detail of the C++ frontend; I'd
> rather implement this in a more general way. And, of course, it doesn't
> work if the attributes are specified after the class.
It's crude, but this fix is needed for making C++ static class variables
work when imported from a DLL.
I agree that this kludge doesn't work when the attribute is specified
*after* the class; one consolation however is that MSVC can't handle
it either, and no existing code will use it as such.
Your call obviously.
After 1.1 is out, I'll submit a patch that adds first-class attributes
for dllimport/dllexport which will obviate the current check for machine
decl/type attributes in the C++ front-end (decl2.cc:import_export_class),
and hopefully will ease the process of doing this right.