Jonas Maebe schrieb:

Const is a pascal keyword which can mean for pascal "pass records
by reference".

Making it mean that would make a lot of code less efficient. It
doesn't have that meaning for the i386 "register" calling convention
either (and it cannot be made to mean that there, because that would
break Delphi compatibility).

AFAIR Delphi treats the byval/byref issue as "compiler specific", so nothing can be broken - apart from code that is bound to an specific compiler.

If you need to pass a record by value to some system C routine then
don't mark that argument as const during the header convertion.
What is wrong?

A const record cannot be passed as a non-const parameter. This is the only difference between constref and var. Thus "const var" could have been used instead of a new "constref" keyword.

DoDi

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to