Selaa lähdekoodia

* more fixes for 64 bit compilation after Peter's changes
* updated and added a warning notice about changing structures in this file to objpash.inc

git-svn-id: trunk@2547 -

tom_at_work 19 vuotta sitten
vanhempi
commit
f86ee115d8
2 muutettua tiedostoa jossa 17 lisäystä ja 15 poistoa
  1. 3 13
      rtl/inc/objpas.inc
  2. 14 2
      rtl/inc/objpash.inc

+ 3 - 13
rtl/inc/objpas.inc

@@ -127,24 +127,14 @@
         var
            intftable : pinterfacetable;
            i : longint;
-{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
-           IOffset : longint;
-{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
         begin
           while assigned(objclass) do
             begin
                intftable:=pinterfacetable((pointer(objclass)+vmtIntfTable)^);
                if assigned(intftable) then
                  for i:=0 to intftable^.EntryCount-1 do
-{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
-                   begin
-                     move(intftable^.Entries[i].IOffset,IOffset,sizeof(longint));
-                     move(pointer(intftable^.Entries[i].VTable),ppointer(@(PChar(instance)[IOffset]))^,sizeof(pointer));
-                   end;
-{$else FPC_REQUIRES_PROPER_ALIGNMENT}
                    ppointer(@(PChar(instance)[intftable^.Entries[i].IOffset]))^:=
                      pointer(intftable^.Entries[i].VTable);
-{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
                objclass:=pclass(pointer(objclass)+vmtParent)^;
             end;
         end;
@@ -453,10 +443,10 @@
            while assigned(vmt) do
              begin
                 p:=(pointer(vmt)+vmtMsgStrPtr);
-                If (P<>Nil) and (PDWord(P)^<>0) then
+                If (P<>Nil) and (PPtrInt(P)^<>0) then
                   begin
-                  count:=pdword(PSizeUInt(p)^)^;
-                  msgstrtable:=pmsgstrtable(PSizeUInt(P)^+4);
+                  count:=PPtrInt(PSizeUInt(p)^)^;
+                  msgstrtable:=pmsgstrtable(PSizeUInt(P)^+sizeof(ptrint));
                   end
                 else
                   Count:=0;

+ 14 - 2
rtl/inc/objpash.inc

@@ -1,8 +1,20 @@
 {
     This file is part of the Free Pascal run time library.
-    Copyright (c) 1999-2000 by the Free Pascal development team
+    Copyright (c) 1999-2005 by the Free Pascal development team
 
-    This unit makes Free Pascal as much as possible Delphi compatible
+    This unit makes Free Pascal as much as possible Delphi compatible,
+    defining several internal structures for classes, interfaces, and
+    resource strings.
+
+    Additionally this file defines the interface of TObject, providing
+    their basic implementation in the corresponding objpas.inc file.
+
+    WARNING: IF YOU CHANGE SOME OF THESE INTERNAL RECORDS, MAKE SURE
+    TO MODIFY THE COMPILER AND OBJPAS.INC ACCORDINGLY, OTHERWISE
+    THIS WILL LEAD TO CRASHES IN THE RESULTING COMPILER AND/OR RTL.
+
+    IN PARTICULAR, THE IMPLEMENTATION PART OF THIS INCLUDE FILE, 
+    OBJPAS.INC, USES SOME HARDCODED RECORD MEMBER OFFSETS.
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.