[fpc-pascal] Delphi RTTI vs Free Pascal RTTI

Sven Barth pascaldragon at googlemail.com
Sat Mar 25 09:40:41 CET 2017


Am 24.03.2017 19:55 schrieb "Michael Van Canneyt" <michael at freepascal.org>:
>
>
>
> On Fri, 24 Mar 2017, African Wild Dog wrote:
>
>> Hello,
>>
>> I need to write a code compatilble with both free pascal and delphi using
>> the old style RTTI.
>> What are the diferences between delphi's and free pascal's
approach/types?
>>
>> I took a look at delphi's and fpc's TypInfo unit and it looks like the
>> types/functions are compatible.
>
>
> They are. There is one dereference on Delphi which is not present in fpc,
> although in fpc trunk, this additional dereference is there. If you use
the
> standard functions you should not notice this.

The binary data of RTTI added before 3.1.1 now has the double indirection,
but the Delphi-compatible "field" names have only a single indirection for
backwards compatibility (they are properties to the double indirection
fields). RTTI data added in 3.1.1 only has the double indirection.
So this difference needs to be kept in mind and will always result in
ifdefs for RTTI code that handles both Delphi and FPC.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170325/1044c02e/attachment.html>


More information about the fpc-pascal mailing list