extern (D)?

Johannes Pfau nospam at example.com
Fri Jan 18 08:15:19 PST 2013


Am Fri, 18 Jan 2013 01:07:05 +0000 (UTC)
schrieb Justin Whear <justin at economicmodeling.com>:

> 
> You can use "extern(D)" or simply "extern";  this is described here:  
> http://dlang.org/attribute.html#linkage
> 
> Justin

BTW: I wonder how export should be used? It seems like it
currently does nothing (because we only use static linking?).

If we ever wanted to ship phobos as a DLL, wouldn't we have to mark all
functions in phobos as export?

NOTE: Shared libraries on POSIX traditionally export all their members
by default. There are some people trying to change that as exporting
all members can cause performance problems:

http://gcc.gnu.org/wiki/Visibility
http://software.intel.com/en-us/blogs/2010/11/10/limit-performance-impact-of-global-symbols-on-linux
http://www.technovelty.org/code/why-symbol-visibility-is-good.html

So we might consider if we want to hide members in shared objects by
default.


More information about the Digitalmars-d-learn mailing list