[fpc-devel] constref in Windows

Hans-Peter Diettrich DrDiettrich1 at aol.com
Sat Nov 20 04:21:37 CET 2010


Paul Ishenin schrieb:

>> Well, it could be done since "const" is implementation-dependent, but 
>> it would force all non-x86 platforms to pass all const parameters by 
>> reference by default, which may not be desirable from an efficiency 
>> point of view.
> As I understand not all const parameters are passed by reference in 
> delphi stdcall implementation but only records? Or say integer/byte will 
> be passed by reference too?

AFAIK references are used for data types, that exceed the size of an 
pointer.

I'd suggest that "constref" works like const, except on platforms or for 
external libraries, that expect only references for const arguments. The 
exceptions then can be handled by an according mode switch.

DoDi




More information about the fpc-devel mailing list