diff --git a/dstep/translator/Translator.d b/dstep/translator/Translator.d index d504f6cb..6818edc2 100644 --- a/dstep/translator/Translator.d +++ b/dstep/translator/Translator.d @@ -301,12 +301,12 @@ class Translator auto function_ = Function( cursor: cursor.func, name: declName, - mangledName: cursor.mangling.some + mangledName: none!string, // handle below ); auto declarationResult = translateFunction(this.context, function_); - output.singleLine("extern (C) private static"); + output.singleLine(`extern (C) private static pragma(mangle, "%s")`, cursor.mangling); output.adaptiveSourceNode(declarationResult); output.append(";"); }); diff --git a/tests/unit/ApiNotes.d b/tests/unit/ApiNotes.d index 495490ba..ca941de5 100644 --- a/tests/unit/ApiNotes.d +++ b/tests/unit/ApiNotes.d @@ -244,8 +244,8 @@ struct Bar return __foo(this, __traits(parameters)); } - extern (C) private static - pragma(mangle, "foo") void __foo (Bar bar, int a); + extern (C) private static pragma(mangle, "foo") + void __foo (Bar bar, int a); } D", options, annotatedFile: "Bar.d"); } @@ -274,8 +274,8 @@ struct Bar return __foo(&this, __traits(parameters)); } - extern (C) private static - pragma(mangle, "foo") void __foo (Bar* bar, int a); + extern (C) private static pragma(mangle, "foo") + void __foo (Bar* bar, int a); } D", options, annotatedFile: "Bar.d"); }