Thread overview | |||||
---|---|---|---|---|---|
|
March 18, 2015 calling C variadic arguments with no 'argc' and only variadic arguments | ||||
---|---|---|---|---|
| ||||
So I ported the C API for MathGL to D, and it is up at code.dlang.org (under dmathgl). MathGL is a nice plotting library. http://mathgl.sourceforge.net/doc_en/Pictures.html#Pictures Later I will work on porting the C++ interface, but so far it at least works for the simplest sample. (Not tried anything else as they are all written in C++). DMD gave me an error message for the following declarations: double mgl_rnd (...); double mgl_rnd_ (...); It says I need at least one fixed argument first. But the C headers are as they are. I could work around this by writing a C stub double mgl_rnd_(int dummy, ...) but is there any way to call these functions without this workaround? |
March 18, 2015 Re: calling C variadic arguments with no 'argc' and only variadic arguments | ||||
---|---|---|---|---|
| ||||
Posted in reply to Laeeth Isharc | On 03/17/2015 06:13 PM, Laeeth Isharc wrote: > DMD gave me an error message for the following declarations: > > double mgl_rnd (...); > double mgl_rnd_ (...); Are you sure those are the right signatures? I don't think those functions take any parameters at all. I would try these: double mgl_rnd (); double mgl_rnd_ (); Ali |
March 18, 2015 Re: calling C variadic arguments with no 'argc' and only variadic arguments | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On Wednesday, 18 March 2015 at 05:38:40 UTC, Ali Çehreli wrote:
> On 03/17/2015 06:13 PM, Laeeth Isharc wrote:
>
> > DMD gave me an error message for the following declarations:
> >
> > double mgl_rnd (...);
> > double mgl_rnd_ (...);
>
> Are you sure those are the right signatures? I don't think those functions take any parameters at all. I would try these:
>
> double mgl_rnd ();
> double mgl_rnd_ ();
>
> Ali
My mistake. Dstep got confused in the translation and wrote the sig as ...and I was tired and didnt check. Thanks for looking into it.
|
Copyright © 1999-2021 by the D Language Foundation