mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-29 23:08:31 +02:00
* undo previous commit
This commit is contained in:
parent
9f66d3bc05
commit
c412dedb8c
@ -324,7 +324,7 @@ end;
|
|||||||
{$ifndef FPC_SYSTEM_HAS_FPC_HELP_CONSTRUCTOR}
|
{$ifndef FPC_SYSTEM_HAS_FPC_HELP_CONSTRUCTOR}
|
||||||
{ Note: _vmt will be reset to -1 when memory is allocated,
|
{ Note: _vmt will be reset to -1 when memory is allocated,
|
||||||
this is needed for fpc_help_fail }
|
this is needed for fpc_help_fail }
|
||||||
procedure fpc_help_constructor;[public,alias:'FPC_HELP_CONSTRUCTOR'];{$ifdef hascompilerproc}compilerproc;{$endif}
|
function fpc_help_constructor(_self:pointer;var _vmt:pointer;_vmt_pos:cardinal):pointer;[public,alias:'FPC_HELP_CONSTRUCTOR'];{$ifdef hascompilerproc}compilerproc;{$endif}
|
||||||
type
|
type
|
||||||
ppointer = ^pointer;
|
ppointer = ^pointer;
|
||||||
pvmt = ^tvmt;
|
pvmt = ^tvmt;
|
||||||
@ -334,12 +334,11 @@ type
|
|||||||
end;
|
end;
|
||||||
var
|
var
|
||||||
vmtcopy : pointer;
|
vmtcopy : pointer;
|
||||||
_self:pointer;var _vmt:pointer;_vmt_pos:cardinal;result:pointer;
|
|
||||||
begin
|
begin
|
||||||
{ Inherited call? }
|
{ Inherited call? }
|
||||||
if _vmt=nil then
|
if _vmt=nil then
|
||||||
begin
|
begin
|
||||||
result:=_self;
|
fpc_help_constructor:=_self;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
vmtcopy:=_vmt;
|
vmtcopy:=_vmt;
|
||||||
@ -355,14 +354,14 @@ begin
|
|||||||
fillchar(_self^,pvmt(vmtcopy)^.size,#0);
|
fillchar(_self^,pvmt(vmtcopy)^.size,#0);
|
||||||
ppointer(_self+_vmt_pos)^:=vmtcopy;
|
ppointer(_self+_vmt_pos)^:=vmtcopy;
|
||||||
end;
|
end;
|
||||||
result:=_self;
|
fpc_help_constructor:=_self;
|
||||||
end;
|
end;
|
||||||
{$endif FPC_SYSTEM_HAS_FPC_HELP_CONSTRUCTOR}
|
{$endif FPC_SYSTEM_HAS_FPC_HELP_CONSTRUCTOR}
|
||||||
|
|
||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_FPC_HELP_DESTRUCTOR}
|
{$ifndef FPC_SYSTEM_HAS_FPC_HELP_DESTRUCTOR}
|
||||||
{ Note: _self will not be reset, the compiler has to generate the reset }
|
{ Note: _self will not be reset, the compiler has to generate the reset }
|
||||||
procedure fpc_help_destructor(var _self : pointer; vmt : pointer; vmt_pos : cardinal);[public,alias:'FPC_HELP_DESTRUCTOR']; {$ifdef hascompilerproc} compilerproc; {$endif}
|
procedure fpc_help_destructor(_self,_vmt:pointer;vmt_pos:cardinal);[public,alias:'FPC_HELP_DESTRUCTOR']; {$ifdef hascompilerproc} compilerproc; {$endif}
|
||||||
type
|
type
|
||||||
ppointer = ^pointer;
|
ppointer = ^pointer;
|
||||||
pvmt = ^tvmt;
|
pvmt = ^tvmt;
|
||||||
@ -378,9 +377,9 @@ begin
|
|||||||
if (pvmt(ppointer(_self+vmt_pos)^)^.size=0) or
|
if (pvmt(ppointer(_self+vmt_pos)^)^.size=0) or
|
||||||
(pvmt(ppointer(_self+vmt_pos)^)^.size+pvmt(ppointer(_self+vmt_pos)^)^.msize<>0) then
|
(pvmt(ppointer(_self+vmt_pos)^)^.size+pvmt(ppointer(_self+vmt_pos)^)^.msize<>0) then
|
||||||
RunError(210);
|
RunError(210);
|
||||||
if (vmt = nil) then
|
if (_vmt = nil) then
|
||||||
exit;
|
exit;
|
||||||
objectsize:=pvmt(vmt)^.size;
|
objectsize:=pvmt(_vmt)^.size;
|
||||||
{ reset vmt to nil for protection }
|
{ reset vmt to nil for protection }
|
||||||
ppointer(_self+vmt_pos)^:=nil;
|
ppointer(_self+vmt_pos)^:=nil;
|
||||||
freemem(_self,objectsize);
|
freemem(_self,objectsize);
|
||||||
@ -390,7 +389,7 @@ end;
|
|||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_FPC_HELP_FAIL}
|
{$ifndef FPC_SYSTEM_HAS_FPC_HELP_FAIL}
|
||||||
{ Note: _self will not be reset, the compiler has to generate the reset }
|
{ Note: _self will not be reset, the compiler has to generate the reset }
|
||||||
procedure fpc_help_fail(var _self:pointer;var vmt:pointer;vmt_pos:cardinal);[public,alias:'FPC_HELP_FAIL'];compilerproc;
|
procedure fpc_help_fail(_self:pointer;var _vmt:pointer;vmt_pos:cardinal);[public,alias:'FPC_HELP_FAIL'];compilerproc;
|
||||||
type
|
type
|
||||||
ppointer = ^pointer;
|
ppointer = ^pointer;
|
||||||
pvmt = ^tvmt;
|
pvmt = ^tvmt;
|
||||||
@ -399,10 +398,10 @@ type
|
|||||||
parent : pointer;
|
parent : pointer;
|
||||||
end;
|
end;
|
||||||
begin
|
begin
|
||||||
if vmt=nil then
|
if _vmt=nil then
|
||||||
exit;
|
exit;
|
||||||
{ vmt=-1 when memory was allocated }
|
{ vmt=-1 when memory was allocated }
|
||||||
if longint(vmt)=-1 then
|
if longint(_vmt)=-1 then
|
||||||
begin
|
begin
|
||||||
if (_self=nil) or (ppointer(_self+vmt_pos)^=nil) then
|
if (_self=nil) or (ppointer(_self+vmt_pos)^=nil) then
|
||||||
HandleError(210)
|
HandleError(210)
|
||||||
@ -412,7 +411,7 @@ begin
|
|||||||
freemem(_self);
|
freemem(_self);
|
||||||
{ reset _vmt to 0 so it will not be freed a
|
{ reset _vmt to 0 so it will not be freed a
|
||||||
second time }
|
second time }
|
||||||
vmt:=0;
|
_vmt:=0;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -422,7 +421,7 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_FPC_NEW_CLASS}
|
{$ifndef FPC_SYSTEM_HAS_FPC_NEW_CLASS}
|
||||||
function fpc_new_class(_vmt:pointer;_self:pointer):pointer;[public,alias:'FPC_NEW_CLASS']; {$ifdef hascompilerproc} compilerproc; {$endif}
|
function fpc_new_class(_self,_vmt:pointer):pointer;[public,alias:'FPC_NEW_CLASS']; {$ifdef hascompilerproc} compilerproc; {$endif}
|
||||||
begin
|
begin
|
||||||
{ Inherited call? }
|
{ Inherited call? }
|
||||||
if _vmt=nil then
|
if _vmt=nil then
|
||||||
@ -437,7 +436,7 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_FPC_DISPOSE_CLASS}
|
{$ifndef FPC_SYSTEM_HAS_FPC_DISPOSE_CLASS}
|
||||||
procedure fpc_dispose_class(_self: tobject; flag : longint);[public,alias:'FPC_DISPOSE_CLASS'];compilerproc;
|
procedure fpc_dispose_class(_self: pointer; flag : longint);[public,alias:'FPC_DISPOSE_CLASS'];compilerproc;
|
||||||
begin
|
begin
|
||||||
{ inherited -> flag = 0 -> no destroy }
|
{ inherited -> flag = 0 -> no destroy }
|
||||||
{ normal -> flag = 1 -> destroy }
|
{ normal -> flag = 1 -> destroy }
|
||||||
@ -963,9 +962,8 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.52 2003-04-01 21:12:40 mazen
|
Revision 1.53 2003-04-02 14:05:45 peter
|
||||||
* making sparc compiling again by adapting compilerproc declarations after the
|
* undo previous commit
|
||||||
last change of compilerproc by i386 team.
|
|
||||||
|
|
||||||
Revision 1.51 2003/03/26 00:17:34 peter
|
Revision 1.51 2003/03/26 00:17:34 peter
|
||||||
* generic constructor/destructor fixes
|
* generic constructor/destructor fixes
|
||||||
|
Loading…
Reference in New Issue
Block a user