January 07, 2005
Suppose the main() *HAS TO BE* in C, what's the correct way to init D's runtime so C call D func later?

I checked: http://www.digitalmars.com/d/windows.html

It seems we can do something like this:

main.c:

int main()
{
gc_init();			// initialize GC
_minit();			// initialize module list
_moduleCtor();		// run module constructors
_moduleUnitTests();		// run module unit tests

..
callCFunc();
callDFunc();

}

Can anyone confirm this is the correct way to init D runtime in general (on both
Linux & Win32)?



January 07, 2005
Check out the source code \dmd\src\phobos\internal\dmain2.d, that should provide all the info needed.

<newbie@d.com> wrote in message news:crlbv0$13gr$1@digitaldaemon.com...
> Suppose the main() *HAS TO BE* in C, what's the correct way to init D's
runtime
> so C call D func later?