[fpc-devel] RTTI

Steve Hildebrandt Steve.Kassel at web.de
Thu Sep 10 16:31:09 CEST 2015



Am 10.09.2015 um 12:10 schrieb Alfred:
> 1:
> I need to know before compiling the source if interface RTTI is 
> available.
> I would like to use a switch in the source:
> {$ifdef HASNEWINTERFACERTTI}
> ....
> {$endif}
Will see what I can do in that direction.
> 2:
> Well ... this is the FPC/Delphi structure at the moment:
> TIntfMethodEntryTail =
>     {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
>     packed
>     {$endif}
>     record
>       {$ifdef FPC}
>       Version: Byte; // always 3 at the moment
>       {$else} // Delphi
>       Kind: TMethodKind;
>       {$endif}
>       CC: TCallingConvention;
>       {$ifdef FPC}
>       ResultType: PTypeInfo;
>       StackSize: Word;
>       {$endif}
>       ParamCount: Byte;
>       {Params: array[0..ParamCount - 1] of TVmtMethodParam;}
>   end;
This confuses me a bit. I implemented this against the following 
requirements:
Interface method information (TIntfMethodEntry):
1. Method name as a shortstring (Name)
2. Byte with version of RTTI, equals 3 in Delphi XE4 (version)
3. Calling convention as enumerated: TCallConv (CC)
4. Pointer to result Type (ResultType)
5. Word with total size of data needed for stack parameters + 
2*SizeOf(Pointer)
    (Return address + Base address for stack parameters)
6. Byte with count of parameters  (ParamCount)
7. An array of VMT method parameter descriptions (Params, type 
TVmtMethodParam)

Is TIntfMethodEntryTail conform with new delphi versions?

greets Steve




More information about the fpc-devel mailing list