[fpc-devel] QueryInterface on linux/i386 - adding 'in' parameter type?

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Aug 29 13:37:16 CEST 2010


On 28 Aug 2010, at 15:22, Marco van de Voort wrote:

> In our previous episode, Jonas Maebe said:
>> 
>> I don't like the ability to change the meaning of keywords using switches
>> like that.  It makes code harder to read, because you have to know which
>> switches are active before you know what the code actually means.
> 
> It is meant to avoid a heavy ifdefed solution which is IMHO even worse. 

That should not be required here. Afaik, only AddRef() and ReleaseRef() need it. All other routines are safecall, which can be used in FPC (after Joost's patch) and on Delphi.

> It is also meant to avoid the combinatorial aspect.  For calling conventions
> you need a separate one for each detail deviation.  Or you need to introduce
> separate modifiers for separate aspects of the calling convention.

A constref parameter is a different kind of parameter, just like a value, var and out parameter (basically the equivalent of a "typename const *" parameter in C). A header can perfectly contain both plain "const" and "constref" parameters of the same type passed to routines using the same calling convention.


Jonas


More information about the fpc-devel mailing list