[fpc-devel] RTTI

Alfred alfred at consulab.nl
Thu Sep 10 12:10:48 CEST 2015


Answer of Steve included in this mail, while missing in list !

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}

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;

Alfred.

>What exactly does the flag indicate.
>1. Reading the structure as in typinfo woks
>2. Register / Offset have meaningfull values instead of default 0 / 0 
>(for unimplemented targets)
>>2: Alignment
>>Using brute force (due to lacking compiler knowledge), I could dig 
>>into ARM alignment issues. No problem.
>>However, at the moment, the issues are known (and correctly 
>>implemented in mORMot).
>>So, I have to know the goal.
>>This cast works again: PVmtMethodParam(p)^
>This was the important part.
>>This cast does not work: PIntfMethodEntry(p)^
>In my opinion, as long as there is no delphi compatibility broken, the 
>target is whatever we feel comfortable with.
>>Question: What alignment issues should have to be solved ?
>If there is no issue with how its currently handled. I would say leave 
>it as is.
>
>greets Steve




More information about the fpc-devel mailing list