2
0
Эх сурвалжийг харах

+ Initial variant support

michael 24 жил өмнө
parent
commit
2a27de0fb0

+ 13 - 7
rtl/i386/rttip.inc

@@ -17,8 +17,8 @@
 { I think we should use the pascal version, this code isn't     }
 { much faster                                                   }
 
-{$define FPC_SYSTEM_HAS_FPC_INITIALIZE}
-
+{ $define FPC_SYSTEM_HAS_FPC_INITIALIZE}
+{
 Procedure fpc_Initialize (Data,TypeInfo : pointer);[Public,Alias:'FPC_INITIALIZE']; {$ifdef hascompilerproc} compilerproc; {$endif}
 assembler;
 asm
@@ -60,6 +60,9 @@ asm
         jmp     .LExitInitialize
         // Variants
 .LDoVariantInit:
+        movl    Data,%eax
+        pushl   %eax
+        call    FPC_VARIANT_INIT
         jmp     .LExitInitialize
         // dynamic Array
 .LDoDynArrayInit:
@@ -132,10 +135,10 @@ asm
         pop     %ebx
         pop     %eax
 end;
+}
 
-
-{$define FPC_SYSTEM_HAS_FPC_FINALIZE}
-
+{$ define FPC_SYSTEM_HAS_FPC_FINALIZE}
+{
 Procedure fpc_finalize (Data,TypeInfo: Pointer);[Public,Alias:'FPC_FINALIZE']; {$ifdef hascompilerproc} compilerproc; {$endif}
 assembler;
 asm
@@ -248,7 +251,7 @@ asm
         pop     %ebx
         pop     %eax
 end;
-
+}
 
 {$define FPC_SYSTEM_HAS_FPC_ADDREF}
 
@@ -480,7 +483,10 @@ end;
 
 {
   $Log$
-  Revision 1.10  2001-08-01 15:00:10  jonas
+  Revision 1.11  2001-11-14 22:59:11  michael
+  + Initial variant support
+
+  Revision 1.10  2001/08/01 15:00:10  jonas
     + "compproc" helpers
     * renamed several helpers so that their name is the same as their
       "public alias", which should facilitate the conversion of processor

+ 10 - 2
rtl/inc/genrtti.inc

@@ -23,6 +23,7 @@ Procedure fpc_Initialize (Data,TypeInfo : pointer);saveregisters;[Public,Alias :
   already defined or not so define it locally to avoid problems PM }
 Type
     Pbyte = ^Byte;
+    
 Var Temp       : PByte;
     I          : longint;
     Size,Count : longint;
@@ -54,6 +55,8 @@ begin
         With PRecRec(Temp)^.elements[I] do
           int_Initialize (Data+Offset,Info);
       end;
+    tkVariant:
+      variant_init(Variant(PVarData(Data)^))
   end;
 end;
 {$endif}
@@ -74,7 +77,7 @@ Var Temp       : PByte;
 begin
   Temp:=PByte(TypeInfo);
   case temp^ of
-    tkAstring,tkWstring : AnsiStr_Decr_Ref(Data);
+    tkAstring,tkWstring : fpc_AnsiStr_Decr_Ref(Data);
     tkArray :
       begin
       Temp:=Temp+1;
@@ -97,6 +100,8 @@ begin
         With PRecRec(Temp)^.elements[I] do
           int_Finalize (Data+Offset,Info);
       end;
+    tkVariant:
+      variant_clear(Variant(PVarData(Data)^))
   end;
 end;
 {$endif}
@@ -207,7 +212,10 @@ procedure fpc_FinalizeArray(data,typeinfo : pointer;count,size : longint); [Publ
 
 {
  $Log$
- Revision 1.5  2001-08-01 15:00:10  jonas
+ Revision 1.6  2001-11-14 22:59:11  michael
+ + Initial variant support
+
+ Revision 1.5  2001/08/01 15:00:10  jonas
    + "compproc" helpers
    * renamed several helpers so that their name is the same as their
      "public alias", which should facilitate the conversion of processor

+ 5 - 1
rtl/inc/systemh.inc

@@ -117,6 +117,7 @@ Type
 {$endif SUPPORT_EXTENDED}
 
   PSmallInt           = ^Smallint;
+  PShortInt           = ^Shortint;
   PInteger            = ^Longint;
   PByte               = ^Byte;
   PWord               = ^word;
@@ -554,7 +555,10 @@ const
 
 {
   $Log$
-  Revision 1.38  2001-11-07 14:59:20  michael
+  Revision 1.39  2001-11-14 22:59:11  michael
+  + Initial variant support
+
+  Revision 1.38  2001/11/07 14:59:20  michael
   + Moved PathDelim,DriveDelim,PathSep to sysutilh
 
   Revision 1.37  2001/11/07 13:52:37  michael