[Issue 12575] extern(C) mangling ignored inside mixin template

2019-07-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12575

Dennis  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||dkor...@live.nl
 Resolution|--- |DUPLICATE

--- Comment #3 from Dennis  ---


*** This issue has been marked as a duplicate of issue 962 ***

--


[Issue 12575] extern(C) mangling ignored inside mixin template

2016-03-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12575

Atila Neves  changed:

   What|Removed |Added

 CC||atila.ne...@gmail.com

--- Comment #2 from Atila Neves  ---
The problem with this workaround is that it fails for `extern(C++)` unless you
use `pragma(mangle, ` with the exact same mangling.

--


[Issue 12575] extern(C) mangling ignored inside mixin template

2016-06-06 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12575

det <2k...@gmx.net> changed:

   What|Removed |Added

 CC||2k...@gmx.net

--


[Issue 12575] extern(C) mangling ignored inside mixin template

2017-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12575

Walter Bright  changed:

   What|Removed |Added

   Keywords||mangling
 CC||bugzi...@digitalmars.com

--


[Issue 12575] extern(C) mangling ignored inside mixin template

2014-04-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12575

Andrej Mitrovic  changed:

   What|Removed |Added

 CC||andrej.mitrov...@gmail.com

--- Comment #1 from Andrej Mitrovic  ---
Technically they are part of a "namespace", since you can disambiguate them:

-
mixin template T1()
{
extern(C) void fizzle() { }
}

mixin template T2()
{
extern(C) void fizzle() { }
}

mixin T1!() t1;
mixin T2!() t2;

void main()
{
t1.fizzle();
t2.fizzle();
}
-

So I guess that's why they're mangled. As a workaround you can use this:

-
mixin template T()
{
// or just pragma(mangle, "fizzle"), but this will at least error if
// you change the function name
pragma(mangle, __traits(identifier, fizzle))
extern(C) void fizzle();
}

mixin T!();

void main()
{
fizzle();
}
-

--