mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 21:02:55 +02:00
Fixed generation of unnamed unions handling within objects.
The generated code was missing an identifier and thus was unable to compile. Now we generated a name based on the type and this seems for fix the issues with Gtk3.gir file.
This commit is contained in:
parent
0d14433fe7
commit
0838345684
@ -1523,6 +1523,7 @@ var
|
||||
var
|
||||
SetFound: Boolean;
|
||||
PropType: String;
|
||||
FieldName: String;
|
||||
begin
|
||||
|
||||
if not MeetsVersionConstraints(Field) then
|
||||
@ -1572,7 +1573,11 @@ var
|
||||
Field.CType := AItem.CType+'_union_'+Field.Name;
|
||||
ResolveTypeTranslation(Field);
|
||||
HandleUnion(TgirUnion(Field));
|
||||
TypeDecl.Add(IndentText(SanitizeName(Field.Name, UsedNames)+': '+ Field.TranslatedName+'; //union extracted from object and named '''+Field.TranslatedName+'''',4,0));
|
||||
FieldName := Field.Name;
|
||||
if FieldName = '' then begin
|
||||
FieldName := '__unnamed_field__' + Field.CType;
|
||||
end;
|
||||
TypeDecl.Add(IndentText(SanitizeName(FieldName, UsedNames)+': '+ Field.TranslatedName+'; //union extracted from object and named '''+Field.TranslatedName+'''',4,0));
|
||||
end
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user