On Sat, 06 Jun 2015 14:52:11 -0400, bitwise <[email protected]> wrote:
Any ideas on this would be much appreciated.

Thanks,
   Bit

One thought that just occurred to me would be to require that D dynamic libraries contain a main entry point, like DllMain on Windows. This seems like the only real/reliable option.

The coder would have to explicitly give dmd a module in which to place the constructor/destructor code for images, the same way that dmd adds a C-main in the file where D-main is found. Enforcing this in the future would be a breaking change, but not a dangerous one. It would be a simple link-time error which was easy to fix.

Also, requiring all D binaries to have some kind of entry point would alleviate the need to ever call Runtime.initialize() explicitly.

  Bit

Reply via email to