Thread overview | ||||||
---|---|---|---|---|---|---|
|
November 01, 2007 function pointers with different calling conventions | ||||
---|---|---|---|---|
| ||||
Does anybody know the syntax to declare a function pointer with the windows calling convention? DMD suggests the type of such pointers is int(Windows *)() for example, but this does not work. |
November 01, 2007 Re: function pointers with different calling conventions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lutger | Lutger wrote:
> Does anybody know the syntax to declare a function pointer with the windows calling convention?
>
> DMD suggests the type of such pointers is int(Windows *)() for example, but this does not work.
Try:
extern(Windows) int function() fPointer;
writefln(typeof(fPointer)) will hopefully output "int(Windows *)()"
I don't have a DMD handy to test it so this is a guess.
Regan
|
November 01, 2007 Re: function pointers with different calling conventions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lutger | "Lutger" <lutger.blijdestijn@gmail.com> wrote in message news:fgccpu$3171$1@digitalmars.com... > Does anybody know the syntax to declare a function pointer with the windows calling convention? > > DMD suggests the type of such pointers is int(Windows *)() for example, but this does not work. I use: extern(Windows) alias int function() WinIntFunc; WinIntFunc f; It probably works the same as Regan's way.. |
November 01, 2007 Re: function pointers with different calling conventions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Reply to Jarrett,
> "Lutger" <lutger.blijdestijn@gmail.com> wrote in message
> news:fgccpu$3171$1@digitalmars.com...
>
>> Does anybody know the syntax to declare a function pointer with the
>> windows calling convention?
>>
>> DMD suggests the type of such pointers is int(Windows *)() for
>> example, but this does not work.
>>
> I use:
>
> extern(Windows) alias int function() WinIntFunc;
> WinIntFunc f;
> It probably works the same as Regan's way..
>
not exactly the same (I think) as Regan's also effects the linkage of the variable.
|
Copyright © 1999-2021 by the D Language Foundation