Browse Source

* 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 years ago
parent
commit
f86ee115d8
2 changed files with 17 additions and 15 deletions
  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
         var
            intftable : pinterfacetable;
            intftable : pinterfacetable;
            i : longint;
            i : longint;
-{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
-           IOffset : longint;
-{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
         begin
         begin
           while assigned(objclass) do
           while assigned(objclass) do
             begin
             begin
                intftable:=pinterfacetable((pointer(objclass)+vmtIntfTable)^);
                intftable:=pinterfacetable((pointer(objclass)+vmtIntfTable)^);
                if assigned(intftable) then
                if assigned(intftable) then
                  for i:=0 to intftable^.EntryCount-1 do
                  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]))^:=
                    ppointer(@(PChar(instance)[intftable^.Entries[i].IOffset]))^:=
                      pointer(intftable^.Entries[i].VTable);
                      pointer(intftable^.Entries[i].VTable);
-{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
                objclass:=pclass(pointer(objclass)+vmtParent)^;
                objclass:=pclass(pointer(objclass)+vmtParent)^;
             end;
             end;
         end;
         end;
@@ -453,10 +443,10 @@
            while assigned(vmt) do
            while assigned(vmt) do
              begin
              begin
                 p:=(pointer(vmt)+vmtMsgStrPtr);
                 p:=(pointer(vmt)+vmtMsgStrPtr);
-                If (P<>Nil) and (PDWord(P)^<>0) then
+                If (P<>Nil) and (PPtrInt(P)^<>0) then
                   begin
                   begin
-                  count:=pdword(PSizeUInt(p)^)^;
-                  msgstrtable:=pmsgstrtable(PSizeUInt(P)^+4);
+                  count:=PPtrInt(PSizeUInt(p)^)^;
+                  msgstrtable:=pmsgstrtable(PSizeUInt(P)^+sizeof(ptrint));
                   end
                   end
                 else
                 else
                   Count:=0;
                   Count:=0;

+ 14 - 2
rtl/inc/objpash.inc

@@ -1,8 +1,20 @@
 {
 {
     This file is part of the Free Pascal run time library.
     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,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.