On 10/8/2014 11:43 PM, 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
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.
Define a global variable in druntime in its own module:
__gshared int druntime_flags = 0;
Then, in your app, override it:
__gshared int druntime_flags = values...;