extern(C++, ns)

Rikki Cattermole via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 2 21:34:44 PST 2016


On 03/01/16 6:26 PM, Manu via Digitalmars-d wrote:
> On 3 January 2016 at 15:17, Rikki Cattermole via Digitalmars-d
> <digitalmars-d at puremagic.com <mailto:digitalmars-d at puremagic.com>> wrote:
>
>     Ok, so what I gathered from that is that if a D package/module
>     matches a C++ one in scope, D will only be checked.
>
>
> No, you name conflict error. But that's not the main problem I'm talking
> about, which is that namespace scopes are created and break everything.
>
>     The obvious answer would be to rename the D side, but that really
>     isn't good enough.
>
>
> You don't just go and rename an entire existing project, which is a lib
> in this case (so, also rename all the clients...?) because you need to
> type extern(C++) somewhere :/

Hang on I just tried this on Windows:

module ns.m;

import x.y;
// import x.y : ns.Y; // doesn't work grr
import x.y : Y;


module x.y;

extern(C++, ns) {
	struct Y {
	}
}


Does this work for you?


More information about the Digitalmars-d mailing list