September 06, 2014 extern(C) function declaration inside a function without altering mangling | ||||
---|---|---|---|---|
| ||||
Attachments:
| Is there way to declare a extern(C) function inside a function without altering the mangled name? Should I write a mixin for that based on pragma(mangleof) (used as extern_C_global_scope in example below) ? Or did someone already implement that? extern(C) void foo1(); void fun(){ extern(C) void foo2(); mixin(extern_C_global_scope("void foo3()")); foo1(); //OK foo2(); //will result in link error due to different mangling of foo2. foo3(); //OK } |
Copyright © 1999-2021 by the D Language Foundation