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

Reply via email to