mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 18:24:19 +02:00
+ Initial variant support
This commit is contained in:
parent
9f9c1700b0
commit
2a27de0fb0
@ -17,8 +17,8 @@
|
|||||||
{ I think we should use the pascal version, this code isn't }
|
{ I think we should use the pascal version, this code isn't }
|
||||||
{ much faster }
|
{ 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}
|
Procedure fpc_Initialize (Data,TypeInfo : pointer);[Public,Alias:'FPC_INITIALIZE']; {$ifdef hascompilerproc} compilerproc; {$endif}
|
||||||
assembler;
|
assembler;
|
||||||
asm
|
asm
|
||||||
@ -60,6 +60,9 @@ asm
|
|||||||
jmp .LExitInitialize
|
jmp .LExitInitialize
|
||||||
// Variants
|
// Variants
|
||||||
.LDoVariantInit:
|
.LDoVariantInit:
|
||||||
|
movl Data,%eax
|
||||||
|
pushl %eax
|
||||||
|
call FPC_VARIANT_INIT
|
||||||
jmp .LExitInitialize
|
jmp .LExitInitialize
|
||||||
// dynamic Array
|
// dynamic Array
|
||||||
.LDoDynArrayInit:
|
.LDoDynArrayInit:
|
||||||
@ -132,10 +135,10 @@ asm
|
|||||||
pop %ebx
|
pop %ebx
|
||||||
pop %eax
|
pop %eax
|
||||||
end;
|
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}
|
Procedure fpc_finalize (Data,TypeInfo: Pointer);[Public,Alias:'FPC_FINALIZE']; {$ifdef hascompilerproc} compilerproc; {$endif}
|
||||||
assembler;
|
assembler;
|
||||||
asm
|
asm
|
||||||
@ -248,7 +251,7 @@ asm
|
|||||||
pop %ebx
|
pop %ebx
|
||||||
pop %eax
|
pop %eax
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
|
|
||||||
{$define FPC_SYSTEM_HAS_FPC_ADDREF}
|
{$define FPC_SYSTEM_HAS_FPC_ADDREF}
|
||||||
|
|
||||||
@ -480,7 +483,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
+ "compproc" helpers
|
||||||
* renamed several helpers so that their name is the same as their
|
* renamed several helpers so that their name is the same as their
|
||||||
"public alias", which should facilitate the conversion of processor
|
"public alias", which should facilitate the conversion of processor
|
||||||
|
@ -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 }
|
already defined or not so define it locally to avoid problems PM }
|
||||||
Type
|
Type
|
||||||
Pbyte = ^Byte;
|
Pbyte = ^Byte;
|
||||||
|
|
||||||
Var Temp : PByte;
|
Var Temp : PByte;
|
||||||
I : longint;
|
I : longint;
|
||||||
Size,Count : longint;
|
Size,Count : longint;
|
||||||
@ -54,6 +55,8 @@ begin
|
|||||||
With PRecRec(Temp)^.elements[I] do
|
With PRecRec(Temp)^.elements[I] do
|
||||||
int_Initialize (Data+Offset,Info);
|
int_Initialize (Data+Offset,Info);
|
||||||
end;
|
end;
|
||||||
|
tkVariant:
|
||||||
|
variant_init(Variant(PVarData(Data)^))
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -74,7 +77,7 @@ Var Temp : PByte;
|
|||||||
begin
|
begin
|
||||||
Temp:=PByte(TypeInfo);
|
Temp:=PByte(TypeInfo);
|
||||||
case temp^ of
|
case temp^ of
|
||||||
tkAstring,tkWstring : AnsiStr_Decr_Ref(Data);
|
tkAstring,tkWstring : fpc_AnsiStr_Decr_Ref(Data);
|
||||||
tkArray :
|
tkArray :
|
||||||
begin
|
begin
|
||||||
Temp:=Temp+1;
|
Temp:=Temp+1;
|
||||||
@ -97,6 +100,8 @@ begin
|
|||||||
With PRecRec(Temp)^.elements[I] do
|
With PRecRec(Temp)^.elements[I] do
|
||||||
int_Finalize (Data+Offset,Info);
|
int_Finalize (Data+Offset,Info);
|
||||||
end;
|
end;
|
||||||
|
tkVariant:
|
||||||
|
variant_clear(Variant(PVarData(Data)^))
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -207,7 +212,10 @@ procedure fpc_FinalizeArray(data,typeinfo : pointer;count,size : longint); [Publ
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
+ "compproc" helpers
|
||||||
* renamed several helpers so that their name is the same as their
|
* renamed several helpers so that their name is the same as their
|
||||||
"public alias", which should facilitate the conversion of processor
|
"public alias", which should facilitate the conversion of processor
|
||||||
|
@ -117,6 +117,7 @@ Type
|
|||||||
{$endif SUPPORT_EXTENDED}
|
{$endif SUPPORT_EXTENDED}
|
||||||
|
|
||||||
PSmallInt = ^Smallint;
|
PSmallInt = ^Smallint;
|
||||||
|
PShortInt = ^Shortint;
|
||||||
PInteger = ^Longint;
|
PInteger = ^Longint;
|
||||||
PByte = ^Byte;
|
PByte = ^Byte;
|
||||||
PWord = ^word;
|
PWord = ^word;
|
||||||
@ -554,7 +555,10 @@ const
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
+ Moved PathDelim,DriveDelim,PathSep to sysutilh
|
||||||
|
|
||||||
Revision 1.37 2001/11/07 13:52:37 michael
|
Revision 1.37 2001/11/07 13:52:37 michael
|
||||||
|
Loading…
Reference in New Issue
Block a user