On Wed, 13 Jul 2011 11:32:50 -0400, Daniel Murphy
wrote:
"Andrej Mitrovic" wrote in message
news:mailman.1607.1310570915.14074.digitalmars-d-le...@puremagic.com...
Thanks! I've literally lost an entire day once when I was just
starting using D and C together and had a calling convention mis
"Andrej Mitrovic" wrote in message
news:mailman.1607.1310570915.14074.digitalmars-d-le...@puremagic.com...
> Thanks! I've literally lost an entire day once when I was just
> starting using D and C together and had a calling convention mismatch.
> :x
It's worse than just calling conventions - try
On 7/13/11, Daniel Murphy wrote:
> "Andrej Mitrovic" wrote in message
> news:mailman.1569.1310506439.14074.digitalmars-d-le...@puremagic.com...
>> Is this going to be fixed any time soon? Allowing callbacks with D
>> calling convention where a C callback is expected should be an error,
>> and thi
"Andrej Mitrovic" wrote in message
news:mailman.1569.1310506439.14074.digitalmars-d-le...@puremagic.com...
> Is this going to be fixed any time soon? Allowing callbacks with D
> calling convention where a C callback is expected should be an error,
> and this is like the 10th time I've ran into th
Oh there's a pull already, this is great.
https://github.com/D-Programming-Language/dmd/pull/96
On 7/12/11, Trass3r wrote:
>> Is this going to be fixed any time soon? Allowing callbacks with D
>> calling convention where a C callback is expected should be an error,
>> and this is like the 10th time I've ran into this bug.
>
> http://d.puremagic.com/issues/show_bug.cgi?id=3797
>
Thanks, I'm v
Is this going to be fixed any time soon? Allowing callbacks with D
calling convention where a C callback is expected should be an error,
and this is like the 10th time I've ran into this bug.
http://d.puremagic.com/issues/show_bug.cgi?id=3797
I just had a bug where a D function is implicitly converted to an
extern(C) function pointer.
I've had this definition:
alias extern (C) void function(void* userData) PaStreamFinishedCallback;
And this extern(C) function:
PaError Pa_SetStreamFinishedCallback(PaStream* stream,
PaStreamFinishedCal
On Tue, 12 Jul 2011 09:53:28 -0400, Steven Schveighoffer
wrote:
But wait, don't normal D functions have C calling convention? I thought
that was one of the benefits of D's ABI?
Tested it out, definitely is different. So this clearly needs to be
addressed.
-Steve
On 12/07/2011 13:15, Trass3r wrote:
You should declare the function pointer without the "extern(C)".
Example:
alias int function(void* test) FTInitFunc;
extern(C) int foo(void* test){ }
FTInitFunc foo_ptr = &foo;
This worked for me.
That's a bug.
Oh, well, I forgot to mention that th
On Tue, 12 Jul 2011 09:42:22 -0400, Johannes Pfau wrote:
Steven Schveighoffer wrote:
On Tue, 12 Jul 2011 05:36:15 -0400, Johannes Pfau
wrote:
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(vo
Trass3r wrote:
>> You should declare the function pointer without the "extern(C)".
>>
>> Example:
>> alias int function(void* test) FTInitFunc;
>>
>> extern(C) int foo(void* test){ }
>>
>> FTInitFunc foo_ptr = &foo;
>>
>> This worked for me.
>
>That's a bug.
I agree. It looks like the above c
Steven Schveighoffer wrote:
>On Tue, 12 Jul 2011 05:36:15 -0400, Johannes Pfau
>wrote:
>
>> From a discussion related to derelict:
>> How do you write this:
>> ---
>> alias extern(C) int function(void* test) FTInitFunc;
>> FTInitFunc FT_Init_Free
On Tue, 12 Jul 2011 05:36:15 -0400, Johannes Pfau wrote:
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(void* test) FTInitFunc;
FTInitFunc FT_Init_FreeType
---
You should declare the function pointer without the "extern(C)".
Example:
alias int function(void* test) FTInitFunc;
extern(C) int foo(void* test){ }
FTInitFunc foo_ptr = &foo;
This worked for me.
That's a bug.
On 12/07/2011 11:36, Johannes Pfau wrote:
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(void* test) FTInitFunc;
FTInitFunc FT_Init_FreeType
---
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(void* test) FTInitFunc;
FTInitFunc FT_Init_FreeType
---
without the alias?
-
17 matches
Mail list logo