Issue 11666: "Separation of platforms", and module declaration
H. S. Teoh via Digitalmars-d
digitalmars-d at puremagic.com
Fri Aug 8 22:36:52 PDT 2014
On Sat, Aug 09, 2014 at 05:08:09AM +0000, Mike via Digitalmars-d wrote:
> I'm exploring a technique in D that may help provide an alternate solution
> to issue 11666 - Separate each platform's port to its own folder [1].
>
> The idea is to have the same module declaration in multiple files, but
> guarded by `version`.
>
> // port_linux.d
> version (linux):
> module port;
>
> // port_windows.d
> version (Windows):
> module port;
>
> Unfortunately, this fails to compile with the following error:
> Error: Declaration expected, not 'module'
[...]
What about this:
// port.d
module port;
version(linux)
public import port_linux;
version(Windows)
public import port_windows;
// port_linux.d
... // Linux implementation here
// port_windows.d
... // Windows implementation here
?
T
--
LINUX = Lousy Interface for Nefarious Unix Xenophobes.
More information about the Digitalmars-d
mailing list