[D-runtime] What is the point of _d_run_main() in druntime/src/rt/dmain2.d?

Jacob Carlborg doob at me.com
Sun Aug 11 12:40:02 PDT 2013


On 10 aug 2013, at 00:04, Walter Bright <walter at digitalmars.com> wrote:

> I cannot see any use for it, though there was obviously one in mind when it was created. Does anyone remember? Does anyone use it?


I guess it's so you can implement your own C main function and call "_d_run_main" from it. This is also what the comments say. GDC, and possibly LDC, used this approach long before DMD, perhaps a change to unify the different runtimes. Here's the commit that introduced it, if it helps:

https://github.com/D-Programming-Language/druntime/commit/278968f5029f0cc9137a0d21c641d64604674be2

-- 
/Jacob Carlborg



More information about the D-runtime mailing list