[openbeos] Re: PPC versions

> every function declaration (i.e. prototype) in c/c++ not exhibiting the
'static' qualifier is
> meant to be accessible from outside the module it was defined in - and
thus gets exported.
> whether coders are always careful about that is a different matter.

I think there is another really important reason for the keyword 'export'
or whatever. The keyword 'static' makes a symbol local within one source
file / object
file. Not within one dll. The other object files will know nothing about a
function. And this effect might not be the one you are seeking for. On the
hand, the keyword _EXPORT or whatever it is called will make a symbol public
the outside of the whole dll. You see the difference? 'static' is meant for
symbols within one *object* file, whereas '_EXPORT' is meant for global
of a *dll* file, which may consist out of many object files.

At least I suspect that the linker will handle the stuff this way. In my
opinion '_EXPORT' might be a good thing (although i am currently not
in working for OBOS). On the other hand, one could cope with the exportation
of all symbols in ELF by carefully using namespaces or declaration within
classes in order to avoid name conflicts.


Other related posts: