www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13605] New: Add ability to `version` a module declaration


          Issue ID: 13605
           Summary: Add ability to `version` a module declaration
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: slavo5150 yahoo.com

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'

It could provide some interesting alternatives for Issue 11666.

Recently implemented related enhancements
* Issue 12567 - https://github.com/D-Programming-Language/dmd/pull/3907
* https://github.com/D-Programming-Language/dmd/pull/3947

Oct 12 2014