mixin template, extern(C/Windows) and mangled name

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 31 20:30:08 PDT 2017


On Tuesday, 1 August 2017 at 03:08:30 UTC, Domain wrote:
> And I can see SimpleDllMain in core.sys.windows.dll, the 
> mangled name is correct: DllMain

main, DllMain, and WinMain are special cased...

for yours, I think you'll have to hack it with pragma(mangle)

  mixin template GetMetaData()
  {
      pragma(mangle, "GetMetaData") // or whatever maybe @0 ?
      extern(Windows) MetaData GetMetaData()
      {
          return MetaData();
      }
  }

  mixin GetMetaData;


I think.


More information about the Digitalmars-d-learn mailing list