Re: Calling D code from C

2020-01-08 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 8 January 2020 at 22:00:03 UTC, H. S. Teoh wrote: On Wed, Jan 08, 2020 at 09:42:03PM +, Ferhat Kurtulmuş via Digitalmars-d-learn wrote: [...] What is going on here? The original post date appears as to be of 2005 :D. [...] Haha yeah, I'm not sure why Stefan replied to a post

Re: Calling D code from C

2020-01-08 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 08, 2020 at 09:42:03PM +, Ferhat Kurtulmuş via Digitalmars-d-learn wrote: [...] > What is going on here? The original post date appears as to be of 2005 > :D. [...] Haha yeah, I'm not sure why Stefan replied to a post dating from 2005. T -- Just because you can, doesn't mean y

Re: Calling D code from C

2020-01-08 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 8 January 2020 at 19:05:29 UTC, H. S. Teoh wrote: On Wed, Jan 08, 2020 at 06:12:01PM +, Stefan via Digitalmars-d-learn wrote: [...] But you can easily do the initialization in your D code, by calling rt_init() and rt_term(), like this: [...] extern(C) int rt_init(); extern(C

Re: Calling D code from C

2020-01-08 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 08, 2020 at 06:12:01PM +, Stefan via Digitalmars-d-learn wrote: [...] > But you can easily do the initialization in your D code, by calling > rt_init() and rt_term(), like this: [...] > extern(C) int rt_init(); > extern(C) int rt_term(); > extern(C) __gshared bool rt_initialized = f

Re: Calling D code from C

2020-01-08 Thread Stefan via Digitalmars-d-learn
On Thursday, 26 May 2005 at 20:41:10 UTC, Vathix wrote: The problem is that D's main() initializes things. Using a C main() bypasses that startup code. Put the main() in the D file (with D extern) and have it call a function in the C file that you will treat as main. That's correct, but not

Re: Calling D code from C

2011-09-20 Thread Denis Shelomovskij
20.09.2011 9:55, Jonathan M Davis пишет: Someone who has actually done a C or C++ application or two which used D code should answer this question. I know that there are at least a few folks around here who have done that, but I've never done it myself. http://stackoverflow.com/questions/7480046

Re: Calling D code from C

2011-09-20 Thread Kagamin
Jonathan M Davis Wrote: > Someone who has actually done a C or C++ application or two which used D code > should answer this question. I know that there are at least a few folks > around > here who have done that, but I've never done it myself. > > http://stackoverflow.com/questions/7480046/im

Calling D code from C

2011-09-19 Thread Jonathan M Davis
Someone who has actually done a C or C++ application or two which used D code should answer this question. I know that there are at least a few folks around here who have done that, but I've never done it myself. http://stackoverflow.com/questions/7480046/implementing-a-c-api-in-d