www.digitalmars.com         C & C++   DMDScript  

D.gnu - _Dmodule_ref question

Is there a reason why _Dmodule_ref can't be defined in a d source file?
---------------------
module test;

extern(C)
{
    void* _Dmodule_ref = null;
    int printf(in char* format, ...);

    void main()
    {
        printf("Hello, %s!".ptr, "no runtime".ptr);
    }
}
----------------------

doesn't compile. but removing the _Dmodule_ref declaration from test.d
and creating a test.c file:
----------------------
void* _Dmodule_ref;
----------------------
compiles.
Feb 05 2012