January 07, 2005 how to init D runtime from C's main? | ||||
---|---|---|---|---|
| ||||
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 Re: how to init D runtime from C's main? | ||||
---|---|---|---|---|
| ||||
Posted in reply to newbie | 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? |
Copyright © 1999-2021 by the D Language Foundation