src/mdlldk/initnim

Search:
Group by:
Source   Edit  

NimMain() is a function required to initialize the Nim runtime. As it is not recommended to call it DllMain(), as the Nim compiler does by default, the dlls created by the mdlldk package call NimMain() from the LoadDll() function, which is called by mIRC as soon as a dll is loaded from version 5.8 of mIRC.

For compatibility reasons, every function added by the newProcToExport(), newProcToExportW() and newProcToExportA() templates checks whether the Nim runtime has already been initialized, otherwise they call NimMain().

If compiled with -d:mdlldkNoDllMain, you should initialize the Nim runtime in whatever way suits you best.

Templates

template initNim()

Template that checks if the Nim runtime has already been initialized, if not, calls initNimImpl().

This template does nothing when compiled with -d:mdlldkNoDllMain.

Source   Edit