On Friday, 16 May 2014 at 14:52:17 UTC, Marc Schütz wrote:
But that's extern(C++), not extern(C)...
That should be a different name mangling, so won't link. Winapi
functions are declared as extern "C" for C++ compiler.
On 05/16/2014 08:24 AM, Ali Çehreli wrote:
> On 05/16/2014 08:15 AM, Andrew Brown wrote:
> >void foo(ref int[3] a); // D prototype
> Since we know that references are implemented as pointers, 'ref int[3]
> a' is passed as a.ptr.
Sorry, that's confusing. Yes, it ends up being equal to a.pt
I guess my confusion came about because in the page about
interfacing with C, there's a static array example where
parameters are given in terms D understands:
extern (C)
{
void foo(ref int[3] a); // D prototype
}
I guess D has no problem translating that into a simple pointer
that C can
On 05/16/2014 08:15 AM, Andrew Brown wrote:
> I guess my confusion came about because in the page about interfacing
> with C, there's a static array example where parameters are given in
> terms D understands:
>
> extern (C)
> {
>void foo(ref int[3] a); // D prototype
> }
>
> I guess D has no
On Friday, 16 May 2014 at 14:52:17 UTC, Marc Schütz wrote:
On Friday, 16 May 2014 at 11:42:35 UTC, Kagamin wrote:
For example, windows headers do use C++ &-references in
function signatures and msdn provides code examples using that
convention, the equivalent in D is ref.
But that's extern(C+
On Friday, 16 May 2014 at 11:42:35 UTC, Kagamin wrote:
For example, windows headers do use C++ &-references in
function signatures and msdn provides code examples using that
convention, the equivalent in D is ref.
But that's extern(C++), not extern(C)...
For example, windows headers do use C++ &-references in function
signatures and msdn provides code examples using that convention,
the equivalent in D is ref.
Ali Çehreli:
I don't think that should even be allowed. C functions should
not know or be compatible with 'ref' D parameters. Define the
arguments as simple 'double *' or 'const double *'.
Time ago I suggested something like that, that is not meaningful
to accept extern(C) function signature
That worked a treat! Thank you very much!
On Thursday, 15 May 2014 at 21:11:54 UTC, Ali Çehreli wrote:
On 05/15/2014 01:55 PM, Andrew Brown wrote:
> extern(C) {
>void regress(int nInd, int nCov, ref double[] x, ref
double[] y, ref
> double[] rOut);
> }
I don't think that should even be allo
On 05/15/2014 01:55 PM, Andrew Brown wrote:
> extern(C) {
>void regress(int nInd, int nCov, ref double[] x, ref double[] y, ref
> double[] rOut);
> }
I don't think that should even be allowed. C functions should not know
or be compatible with 'ref' D parameters. Define the arguments as simpl
10 matches
Mail list logo