[ODE] Why no __declspec(dllexport)

Martin C. Martin martin at metahuman.org
Tue Apr 27 12:41:11 MST 2004


gl wrote:

> The whole idea is that you can very specifically define the public DLL
> interface, rather than just exporting everything non-static.

While microsoft's interface gives you a little more control, I think 
your use of connotative language gives you away.  "Just exporting 
everything non-static" is the same as "very specifically defining" an 
interface, as long as you're "very specific" about what you declare static.

> We were talking about DLLs,

Right, and I'm pointing out that (a) DLLs are similar in use to static 
libraries, (b) static libraries only have the C "static" keyword to 
define the interface of a compilation unit, and (c) for static 
libraries, no one really complains about lack of any interface 
specification mechanism.

 > which is where you can use the
> __declspec(dllimport/dllexport) semantics in VC.

Right.  DLLs have them.  Static libs don't.  People switch between 
static libs and DLLs pretty easily.  I've never heard anyone complain 
that static libs need a more fine grained way of specifying their 
interface.  Therefore, I suspect they're not really needed for DLLs either.

> The reason I sighed because of the automatic 'MS is evil' assumption.

It's a good thing I didn't assume it, then, but rather said "either 
microsoft is being evil, or the feature had more problems than solutions 
in retrospect."  Are you sure you didn't just knee-jerk to the first 
half of that thought?

> This stuff is there because it genuinely makes life much easier on us.

I've never heard anyone on Linux, Solaris or IRIX complain about the 
lack of it.  I can't remember how it worked on the Amiga, but if I lost 
it in moving to Unix, I didn't miss it.  Same with MacOS.

- Martin




More information about the ODE mailing list