Thread overview
calling C variadic arguments with no 'argc' and only variadic arguments
Mar 18, 2015
Laeeth Isharc
Mar 18, 2015
Ali Çehreli
Mar 18, 2015
Laeeth Isharc
March 18, 2015
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
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
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.