Nice! Yah I’m not too familiar with the inner parts of NimMain. But it sounds about right. Any code in modules that live outside proc’s will get called from NimMain.
I’m not sure what you meant by PreMain calling NimMain, but NimMain is called from a C main function. That’s what you disable for embedded platforms. But NimMain still needs to be called once at startup. Otherwise you get really weird faults. The N_CDECL piece is just a C macro that declares the C function NimMain. It’s done that way to control the function declaration for various compilers and settings.
