www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24418] New: ImportC: can't import C file with fully qualified

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

          Issue ID: 24418
           Summary: ImportC: can't import C file with fully qualified name
                    if C file on the command line
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: atila.neves gmail.com

---------
// source/foo/bar/quux.c
int twice(int i) { return i * 2; }

// source/mod.d
import foo.bar.quux;
---------


% dmd -c -Isource source/mod.d source/foo/bar/quux.c

source/mod.d(1): Error: module `quux` from file source/foo/bar/quux.c must be
imported with 'import quux;'

It doesn't help that one can't explicitly declare the module name since quux.c
is a C file.

--
Feb 28