D2 port of Sociomantic CDGC available for early experiments

Jacob Carlborg via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu Oct 9 06:31:13 PDT 2014


On 09/10/14 08:43, Rainer Schuetze wrote:

> Yes, but the problem is not to access command line arguments, but to run
> code before the GC initialization i.e. before _d_run_main is executed.
>
> If we can assume a C++ backend, using static initialization of a C++
> global could work:
>
>     static bool initGC = configureGC();
>
> because the C++ runtime runs configureGC before calling C main. I'd
> rather like to see a solution using D, though.

It's enough with a C function with __attribute__((constructor)). This 
will run before C main.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list