Calling D from C

2012-03-12 Thread Chris W.
I have a problem when calling D functions from C. While I can perform simple arithmetic operations (i.e. the calculation is performed in D and returned to C), I experience problems when trying to perform string/char operations or call functions from the D standard library (e.g. writefln()). The us

Re: Calling D from C

2012-03-12 Thread Alex Rønne Petersen
On 12-03-2012 15:53, Chris W. wrote: I have a problem when calling D functions from C. While I can perform simple arithmetic operations (i.e. the calculation is performed in D and returned to C), I experience problems when trying to perform string/char operations or call functions from the D stan

Re: Calling D from C

2012-03-12 Thread Steven Schveighoffer
On Mon, 12 Mar 2012 10:53:09 -0400, Chris W. wrote: I have a problem when calling D functions from C. While I can perform simple arithmetic operations (i.e. the calculation is performed in D and returned to C), I experience problems when trying to perform string/char operations or call function

Re: Calling D from C

2012-03-12 Thread Chris W.
On Monday, 12 March 2012 at 15:00:31 UTC, Steven Schveighoffer wrote: On Mon, 12 Mar 2012 10:53:09 -0400, Chris W. wrote: I have a problem when calling D functions from C. While I can perform simple arithmetic operations (i.e. the calculation is performed in D and returned to C), I experience

Re: Calling D from C

2012-03-12 Thread Alex Rønne Petersen
On 12-03-2012 16:09, Chris W. wrote: On Monday, 12 March 2012 at 15:00:31 UTC, Steven Schveighoffer wrote: On Mon, 12 Mar 2012 10:53:09 -0400, Chris W. wrote: I have a problem when calling D functions from C. While I can perform simple arithmetic operations (i.e. the calculation is performed

Re: Calling D from C

2012-03-12 Thread Chris W.
On Monday, 12 March 2012 at 15:17:32 UTC, Alex Rønne Petersen wrote: On 12-03-2012 16:09, Chris W. wrote: On Monday, 12 March 2012 at 15:00:31 UTC, Steven Schveighoffer wrote: On Mon, 12 Mar 2012 10:53:09 -0400, Chris W. wrote: I have a problem when calling D functions from C. While I can p

Re: Calling D from C

2012-03-12 Thread Alex Rønne Petersen
On 12-03-2012 16:36, Steven Schveighoffer wrote: On Mon, 12 Mar 2012 11:17:31 -0400, Alex Rønne Petersen wrote: On 12-03-2012 16:09, Chris W. wrote: On Monday, 12 March 2012 at 15:00:31 UTC, Steven Schveighoffer wrote: On Mon, 12 Mar 2012 10:53:09 -0400, Chris W. wrote: I have a problem w

Re: Calling D from C

2012-03-12 Thread Steven Schveighoffer
On Mon, 12 Mar 2012 11:17:31 -0400, Alex Rønne Petersen wrote: On 12-03-2012 16:09, Chris W. wrote: On Monday, 12 March 2012 at 15:00:31 UTC, Steven Schveighoffer wrote: On Mon, 12 Mar 2012 10:53:09 -0400, Chris W. wrote: I have a problem when calling D functions from C. While I can perf

Re: Calling D from C

2012-03-12 Thread Steven Schveighoffer
On Mon, 12 Mar 2012 11:36:45 -0400, Steven Schveighoffer wrote: On Mon, 12 Mar 2012 11:17:31 -0400, Alex Rønne Petersen wrote: On 12-03-2012 16:09, Chris W. wrote: On Monday, 12 March 2012 at 15:00:31 UTC, Steven Schveighoffer wrote: On Mon, 12 Mar 2012 10:53:09 -0400, Chris W. wrote:

Re: Calling D from C

2012-03-12 Thread Chris W.
On Monday, 12 March 2012 at 15:39:15 UTC, Alex Rønne Petersen wrote: On 12-03-2012 16:36, Steven Schveighoffer wrote: On Mon, 12 Mar 2012 11:17:31 -0400, Alex Rønne Petersen wrote: On 12-03-2012 16:09, Chris W. wrote: On Monday, 12 March 2012 at 15:00:31 UTC, Steven Schveighoffer wrote: On M

Re: Calling D from C

2012-03-12 Thread Stewart Gordon
On 12/03/2012 15:38, Steven Schveighoffer wrote: 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

Re: Calling D from C

2012-03-12 Thread Sean Kelly
On Mar 12, 2012, at 9:54 AM, Stewart Gordon wrote: > On 12/03/2012 15:38, Steven Schveighoffer wrote: > >>> 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

Re: Calling D from C

2012-03-12 Thread Steven Schveighoffer
On Mon, 12 Mar 2012 12:54:25 -0400, Stewart Gordon wrote: On 12/03/2012 15:38, Steven Schveighoffer wrote: 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 realiz