Why are extern(C/C++) definitions and references mangled differently in separately compiled modules?

Max Samukha maxsamukha at gmail.com
Sat Sep 7 14:09:04 UTC 2019


On Saturday, 7 September 2019 at 13:01:38 UTC, Jacob Carlborg 
wrote:
> On 2019-09-06 21:03, Max Samukha wrote:
>
>> Is there any practical use of having identically named .d and 
>> .di alongside?
>
> Same as in C/C++. This allows you to have a header file if you 
> want to distribute a closed source library.

I know, but I have never seen a D project that would generate 
headers into the source directory. C++ requires headers for 
sharing declarations with other translation units in the project, 
even if the headers are not intended for distribution. That is 
why having headers alongside implementations is a common case 
there. D doesn't require that.

Anyway, that's a minor concern. Thank you.


More information about the Digitalmars-d-learn mailing list