[fpc-devel] QueryInterface on linux/i386 - adding 'in' parameter type?
jonas.maebe at elis.ugent.be
Sat Aug 28 15:09:23 CEST 2010
On 28 Aug 2010, at 14:54, Joost van der Sluis wrote:
> I would say 'constref'. But what do you thing of the idea from Marco to
> use a directive? It will avoid problems with Delphi-compatibility.
Probably being predictable again: 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. In case of mwpascal, the modifier that influences the behaviour is right next to the declaration, so the context is clear (unless you use macros, but it's possible to obfuscate everything using that feature).
>> Another option is to declare it as "mwpascal" instead of "cdecl". The mwpascal calling convention is identical to cdecl, except that all structured const parameters are passed by reference (for compatibility with the MetroWerks Pascal compiler).
> Hey, that's the easiest for me, now. No need to change the compiler. But
> i'm not sure that this is the best solution for the long run.
My second preference would be something like constref.
More information about the fpc-devel