https://issues.dlang.org/show_bug.cgi?id=13605

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #8 from [email protected] ---
You do realize that in D, the module name must match the source filename,
right? So your proposed solution won't work.

The recommended way to achieve what you want is as follows:

----port_linux.d----
module port_linux;
... // Linux stuff here

----port_windows.d----
module port_windows;
... // Windows stuff here

----port.d----
version(linux)
    public import port_linux;
version(Windows)
    public import port_windows;

----main.d----
import port; // will pull in correct version of stuff depending on platform
void main() { ... }

--

Reply via email to