https://issues.dlang.org/show_bug.cgi?id=17747
--- Comment #3 from Илья Ярошенко <ilyayaroshe...@gmail.com> --- (In reply to ZombineDev from comment #2) > AFAIK, C doesn't have static constructors, only C++ has, so your example > should be: > > extern(C++) shared static this() > { > // ... > } > > Of course extern (D) should work too: > > extern(D) shared static this() > { > // ... > } > > I'm not sure if `pragma(mangle, ...) [shared] static this()` should be > allowed as static constructors / destructors are meant to be called only > once and only by the runtime. __attribute__ ((constructor)) is in C. It can be called in start before main, without DRuntime. --