[fpc-pascal] Typinfo incompatibilities between FPC and Delphi

Sven Barth pascaldragon at googlemail.com
Sat May 31 12:04:30 CEST 2014


On 31.05.2014 11:57, Vincent Snijders wrote:
>
>
>
> 2014-05-31 11:48 GMT+02:00 Sven Barth <pascaldragon at googlemail.com
> <mailto:pascaldragon at googlemail.com>>:
>
>     On 31.05.2014 05 <tel:31.05.2014%2005>:53, Kenneth Cochran wrote:
>
>         I'm attempting to port GExperts from Delphi to Lazaurus and
>         noticed the
>         definition of TPropInfo differs from Delphi's.
>
>         In FPC's TPropInfo the PropType field is PTypeInfo whereas in
>         Delphi it
>         is PPTypeInfo. I'm not sure what is actually gained by this
>         extra level
>         of indirection but it exists none the less.
>
>         Are there any plans to update TPropInfo to be compatible with
>         Delphi or
>         do I need to  wrap dependent code with compiler conditionals?
>
>
>     There are no plans as we have to stay compatible with our own old
>     codebases as well. You'll need to use compiler conditionals.
>
>
> I think it is possible to write code without $ifdef (valid for Delphi
> and FPC) if you use the typeinfo unit to extract the information.
> http://www.freepascal.org/docs-html/rtl/typinfo/

No, that is exactly the point. Compare the declaration of TPropInfo in 
Delphi and FPC:

http://docwiki.embarcadero.com/Libraries/XE3/en/System.TypInfo.TPropInfo
http://www.freepascal.org/docs-html/rtl/typinfo/tpropinfo.html

In Delphi you have PropType as PPTypeInfo while in FPC you have PTypeInfo.

Regards,
Sven





More information about the fpc-pascal mailing list