mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-22 03:02:50 +01:00
+ Patch from Jeff Pohlmeyer to process empty structs
This commit is contained in:
parent
515af60a33
commit
be03148a1e
File diff suppressed because it is too large
Load Diff
@ -1315,28 +1315,42 @@ declaration :
|
|||||||
block_type:=bt_type;
|
block_type:=bt_type;
|
||||||
end;
|
end;
|
||||||
shift(3);
|
shift(3);
|
||||||
(* write new type name *)
|
if ( yyv[yysp-1]^.p2 <> nil ) then
|
||||||
TN:=TypeName($1^.p2^.p);
|
begin
|
||||||
PN:=PointerName($1^.p2^.p);
|
(* write new type name *)
|
||||||
(* define a Pointer type also for structs *)
|
TN:=TypeName($1^.p2^.p);
|
||||||
if UsePPointers and (Uppercase(tn)<>Uppercase(pn)) and
|
PN:=PointerName($1^.p2^.p);
|
||||||
assigned($1) and ($1^.typ in [t_uniondef,t_structdef]) then
|
(* define a Pointer type also for structs *)
|
||||||
writeln(outfile,aktspace,PN,' = ^',TN,';');
|
if UsePPointers and (Uppercase(tn)<>Uppercase(pn)) and
|
||||||
write(outfile,aktspace,TN,' = ');
|
assigned($1) and ($1^.typ in [t_uniondef,t_structdef]) then
|
||||||
shift(2);
|
writeln(outfile,aktspace,PN,' = ^',TN,';');
|
||||||
hp:=$1;
|
write(outfile,aktspace,TN,' = ');
|
||||||
write_type_specifier(outfile,hp);
|
shift(2);
|
||||||
popshift;
|
hp:=$1;
|
||||||
(* enum_to_const can make a switch to const *)
|
write_type_specifier(outfile,hp);
|
||||||
if block_type=bt_type then
|
popshift;
|
||||||
writeln(outfile,';');
|
(* enum_to_const can make a switch to const *)
|
||||||
writeln(outfile);
|
if block_type=bt_type then
|
||||||
flush(outfile);
|
writeln(outfile,';');
|
||||||
popshift;
|
writeln(outfile);
|
||||||
if must_write_packed_field then
|
flush(outfile);
|
||||||
write_packed_fields_info(outfile,hp,TN);
|
popshift;
|
||||||
if assigned(hp) then
|
if must_write_packed_field then
|
||||||
dispose(hp,done);
|
write_packed_fields_info(outfile,hp,TN);
|
||||||
|
if assigned(hp) then
|
||||||
|
dispose(hp,done)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
TN:=TypeName(yyv[yysp-1]^.str);
|
||||||
|
PN:=PointerName(yyv[yysp-1]^.str);
|
||||||
|
if UsePPointers then writeln(outfile,aktspace,PN,' = ^',TN,';');
|
||||||
|
writeln(outfile, aktspace, TN, ' = record');
|
||||||
|
writeln(outfile, aktspace, ' {undefined structure}');
|
||||||
|
writeln(outfile, aktspace, ' end;');
|
||||||
|
writeln(outfile);
|
||||||
|
popshift;
|
||||||
|
end;
|
||||||
} |
|
} |
|
||||||
TYPEDEF STRUCT dname dname SEMICOLON
|
TYPEDEF STRUCT dname dname SEMICOLON
|
||||||
{
|
{
|
||||||
@ -2443,7 +2457,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.5 2002-09-07 15:40:33 peter
|
Revision 1.6 2003-02-13 22:20:24 michael
|
||||||
|
+ Patch from Jeff Pohlmeyer to process empty structs
|
||||||
|
|
||||||
|
Revision 1.5 2002/09/07 15:40:33 peter
|
||||||
* old logs removed and tabs fixed
|
* old logs removed and tabs fixed
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user