digitalmars.D - Module on importC
- Andrea Fontana (14/14) Oct 22 2023 Hello,
- Andrea Fontana (3/17) Oct 22 2023 Sorry, I should have posted this on the Learn forum, obviously.
- Adam D Ruppe (6/8) Oct 22 2023 You might have luck with the -mv switch. I blogged about it here:
- Walter Bright (6/23) Oct 22 2023 One way is to create a file "a_b_utils.c" with the contents:
- jmh530 (6/29) Oct 23 2023 I just want to repeat that I liked Steve's suggestion [1] to have
Hello, 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! Andrea
Oct 22 2023
On Sunday, 22 October 2023 at 22:23:23 UTC, Andrea Fontana wrote:Hello, 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! AndreaSorry, I should have posted this on the Learn forum, obviously. Andrea
Oct 22 2023
On Sunday, 22 October 2023 at 22:23:23 UTC, Andrea Fontana wrote:Is there a way to set modules name for importc? Or to give importc a hint directly on C?You might have luck with the -mv switch. I blogged about it here: http://dpldocs.info/this-week-in-d/Blog.Posted_2023_06_05.html Search for the word "importC" in there. It... kinda works. But I consider this to be one of the biggest flaws of the importC system....
Oct 22 2023
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.
Oct 22 2023
On Monday, 23 October 2023 at 00:45:10 UTC, Walter Bright wrote:On 10/22/2023 3:23 PM, Andrea Fontana wrote: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-1430650577Is 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.
Oct 23 2023