On 09.10.2014 08:29, Jacob Carlborg wrote:
On 08/10/14 22:47, Rainer Schuetze wrote:
C main is no longer under user control, because it is auto-generated
with D main. I never liked that change, we've just discovered another
reason.
All platforms have API's to access the command line arguments passed to
"main". On OS X that would be "_NSGetArgv" and "_NSGetArgc".
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.