February 16, 2008 Re: extern(Windows) export in std.c.windows.windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sergey Gromov | Sergey Gromov wrote: > torhu <no@spam.invalid> wrote: >> It's needed when linking to variables that are in a DLL, though. If you don't add it, even variable declarations with the 'extern' storage class will turn into definitions. > > This explains it, thanks. This also means that export is sometimes also import because extern is not actually for an extern symbol but merely a calling convention specifier. This guide mostly explains it: http://www.digitalmars.com/d/2.0/htomodule.html And yes, 'export' is used for imports too. Just 'extern' works like in C, while 'extern (XYZ)' is really an unrelated feature. |
Copyright © 1999-2021 by the D Language Foundation