Browse Source

* 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 -
svenbarth 8 years ago
parent
commit
73ed1a9bf1
2 changed files with 5 additions and 3 deletions
  1. 4 2
      rtl/objpas/typinfo.pp
  2. 1 1
      tests/test/trtti12.pp

+ 4 - 2
rtl/objpas/typinfo.pp

@@ -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;
-                {ManagedFields: array[1..ManagedFldCount] of TManagedField}
+                case Boolean of
+                  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;

+ 1 - 1
tests/test/trtti12.pp

@@ -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