Questions about windows support

torhu no at spam.invalid
Mon Feb 20 19:08:29 PST 2012

On 20.02.2012 22:36, Benjamin Thaut wrote:
> 2) Will dmd support exporting/importing data symbols from dlls? I know
> there is a patch that does the data symbol address patching from the
> runtime but thats a feature that should be supported by the compiler
> directly in my eyes.

Importing data symbols works just fine both in DMD and GDC. At least it 
did a couple of years ago. Can't remember if I've tried exporting, but I 
wouldn't be surprised if it worked.

You don't need to do anything special to get it working, just use 
declare the data as 'export extern extern (C)' in your D code.  For D2 
prefix that with '__gshared'.  Not very elegent, but it does work.

More information about the Digitalmars-d mailing list