Bug 962 – extern C/Windows names D-mangled

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2007-02-14T07:50:16Z
Last change time
2019-07-25T14:51:03Z
Assigned to
Walter Bright
Creator
Chris Miller

Comments

Comment #0 by chris — 2007-02-14T07:50:16Z
I'm sure this has been brought up several times, but in this case I think it should be fixed: template MyFuncs() { export extern(Windows) void foo() { } } mixin MyFuncs; // I expect foo to be mixed in and exported with a normal extern(Windows) signature, yet it is mangled like a D name just because it's in a template. // This is preventing me from writing some useful boilerplate code.
Comment #1 by bugzilla — 2007-08-12T15:45:57Z
But changing the behavior of this would lead to name collisions if something is mixed in more than once, which is why it behaves this way. You can get the behavior you want with a string mixin, or with the (not yet) macro feature of 2.0.
Comment #2 by dkorpel — 2019-07-25T14:51:03Z
*** Issue 12575 has been marked as a duplicate of this issue. ***