Calling D from C

Steven Schveighoffer schveiguy at yahoo.com
Mon Mar 12 10:37:03 PDT 2012


On Mon, 12 Mar 2012 12:54:25 -0400, Stewart Gordon <smjg_1998 at yahoo.com>  
wrote:

> On 12/03/2012 15:38, Steven Schveighoffer wrote:
> <snip>
>>> http://dlang.org/phobos/core_runtime.html#initialize
>>>
>>> And actually, I think this should do everything necessary. No need to  
>>> call gc_init and
>>> thread_attachThis().
>>
>> Hm... just realized you can't do this, since it's a D function :D
>
> Why can't this be dealt with using an extern (C) wrapper function in the  
> D code?

All it does is call the extern(C) rt_init.  It was my bad, if you are in  
D-land, it's definitely better to use Runtime.initialize, but from C, the  
best bet is rt_init.

-Steve


More information about the Digitalmars-d mailing list