* fix for Mantis #31140: applied patch by Maciej Izak; this way it's clear what purpose ManagedFldCount has in FPC compared to Delphi

Commit message of patch:

+ New field TotalFieldCount for TTypeData
* Mark ManagedFldCount as deprecated
* Adjusted test trtti12.pp

git-svn-id: trunk@35180 -
This commit is contained in:
svenbarth 2016-12-23 15:32:44 +00:00
parent 8e765ef807
commit 73ed1a9bf1
2 changed files with 5 additions and 3 deletions

View File

@ -306,8 +306,10 @@ unit typinfo;
RecInitInfo: Pointer; { points to TTypeInfo followed by init table } RecInitInfo: Pointer; { points to TTypeInfo followed by init table }
{$endif VER3_0} {$endif VER3_0}
RecSize: Integer; RecSize: Integer;
ManagedFldCount: Integer; case Boolean of
{ManagedFields: array[1..ManagedFldCount] of TManagedField} False: (ManagedFldCount: Integer deprecated 'Use RecInitData^.ManagedFieldCount or TotalFieldCount depending on your use case');
True: (TotalFieldCount: Integer);
{ManagedFields: array[1..TotalFieldCount] of TManagedField}
); );
tkHelper: tkHelper:
(HelperParentRef : TypeInfoPtr; (HelperParentRef : TypeInfoPtr;

View File

@ -27,7 +27,7 @@ begin
if id.Terminator <> nil then if id.Terminator <> nil then
Halt(1); Halt(1);
if td.ManagedFldCount <> 6 then if td.TotalFieldCount <> 6 then
Halt(2); Halt(2);
if id.ManagedFieldCount <> 3 then if id.ManagedFieldCount <> 3 then