mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 17:30:28 +02:00
+ support for high(dynarray) using compilerproc (forgot to commit
previously)
This commit is contained in:
parent
7d0eafc46f
commit
239d2d6fee
@ -1167,20 +1167,22 @@ implementation
|
|||||||
else
|
else
|
||||||
if is_dynamic_array(left.resulttype.def) then
|
if is_dynamic_array(left.resulttype.def) then
|
||||||
begin
|
begin
|
||||||
{
|
{$ifndef hascompilerproc}
|
||||||
Doesn't work because that procedure isn't in
|
writeln('Error: high(dynamic_array) isn''t implemented yet');
|
||||||
the interface of the system unit :( (JM)
|
codegenerror := true;
|
||||||
|
{$else hascompilerproc}
|
||||||
srsym:=searchsymonlyin(systemunit,'FPC_DYNARRAY_HIGH');
|
{ can't use inserttypeconv because we need }
|
||||||
if not assigned(srsym) then
|
{ an explicit type conversion (JM) }
|
||||||
internalerror(200104291);
|
hp := ctypeconvnode.create(left,voidpointertype);
|
||||||
inserttypeconv(left,voidpointertype);
|
hp.toggleflag(nf_explizit);
|
||||||
hp:=ccallparanode.create(left,nil);
|
hp := ccallparanode.create(hp,nil);
|
||||||
hp:=ccallnode.create(hp,tprocsym(srsym),systemunit,nil);
|
hp := ccallnode.createintern('fpc_dynarray_high',hp);
|
||||||
|
{ make sure the left node doesn't get disposed, since it's }
|
||||||
|
{ reused in the new node (JM) }
|
||||||
left:=nil;
|
left:=nil;
|
||||||
resulttypepass(hp);
|
resulttypepass(hp);
|
||||||
result:=hp;}
|
result:=hp;
|
||||||
{$warning "high(dynamic_array)" isn't implemented yet }
|
{$endif hascompilerproc}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1790,7 +1792,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.44 2001-07-09 21:15:40 peter
|
Revision 1.45 2001-08-06 09:44:10 jonas
|
||||||
|
+ support for high(dynarray) using compilerproc (forgot to commit
|
||||||
|
previously)
|
||||||
|
|
||||||
|
Revision 1.44 2001/07/09 21:15:40 peter
|
||||||
* Length made internal
|
* Length made internal
|
||||||
* Add array support for Length
|
* Add array support for Length
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user