Module on importC

jmh530 john.michael.hall at gmail.com
Mon Oct 23 13:09:17 UTC 2023


On Monday, 23 October 2023 at 00:45:10 UTC, Walter Bright wrote:
> On 10/22/2023 3:23 PM, Andrea Fontana wrote:
>> Is there a way to set modules name for importc? Or to give 
>> importc a hint directly on C?
>> 
>> I'm trying to import a project with a struct like:
>> 
>> ```
>> a/b/utils.c
>> a/b/interface.c
>> 
>> c/d/utils.c
>> c/d/interface.c
>> 
>> e/f/utils.c
>> e/f/interface.c
>> ```
>> 
>> All files conflict with each other!
>
> One way is to create a file "a_b_utils.c" with the contents:
>
> ```
> #include "a/b/utils.c"
> ```
>
> Repeat for the other files.

I just want to repeat that I liked Steve's suggestion [1] to have 
a -CI flag for searching for .h files. Not sure that would solve 
the issue in this case, but I still liked it.

[1] 
https://github.com/dlang/dmd/pull/14864#issuecomment-1430650577


More information about the Digitalmars-d mailing list