Browse Source

+ add types for the VMT's message table (the names are Delphi compatible, even if TVmtMethodEntry has no Len field)

git-svn-id: trunk@37489 -
svenbarth 7 years ago
parent
commit
7e3ad42f33
1 changed files with 32 additions and 0 deletions
  1. 32 0
      rtl/objpas/typinfo.pp

+ 32 - 0
rtl/objpas/typinfo.pp

@@ -383,6 +383,31 @@ unit typinfo;
         property Method[Index: Word]: PIntfMethodEntry read GetMethod;
       end;
 
+      PVmtMethodEntry = ^TVmtMethodEntry;
+      TVmtMethodEntry =
+      {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
+      packed
+      {$endif FPC_REQUIRES_PROPER_ALIGNMENT}
+      record
+        Name: PShortString;
+        CodeAddress: CodePointer;
+      end;
+
+      PVmtMethodTable = ^TVmtMethodTable;
+      TVmtMethodTable =
+      {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
+      packed
+      {$endif FPC_REQUIRES_PROPER_ALIGNMENT}
+      record
+      private
+        function GetEntry(Index: LongWord): PVmtMethodEntry; inline;
+      public
+        Count: LongWord;
+        property Entry[Index: LongWord]: PVmtMethodEntry read GetEntry;
+      private
+        Entries: array[0..0] of TVmtMethodEntry;
+      end;
+
       PRecInitData = ^TRecInitData;
       TRecInitData =
       {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
@@ -2845,6 +2870,13 @@ begin
     end;
 end;
 
+{ TVmtMethodTable }
+
+function TVmtMethodTable.GetEntry(Index: LongWord): PVmtMethodEntry;
+begin
+  Result := PVmtMethodEntry(@Entries[0]) + Index;
+end;
+
 { TVmtFieldTable }
 
 function TVmtFieldTable.GetField(aIndex: Word): PVmtFieldEntry;