Merge branch 'gir2pas' into 'main'

gir2pas: Fixed generation of types based on int32 standard C type.

See merge request freepascal.org/lazarus/lazarus!209
This commit is contained in:
Maxim Ganetsky 2023-06-18 16:29:28 +00:00
commit 127e7afbec
3 changed files with 9 additions and 3 deletions

View File

@ -55,7 +55,7 @@ type
{ TFT_Int32 }
PPFT_Int32 = ^PFT_Int32;
PFT_Int32 = ^TFT_Int32;
TFT_Int32 = int32;
TFT_Int32 = cint32;
procedure FT_Library_Version; cdecl; external;
implementation

View File

@ -23,7 +23,7 @@ unit girCTypesMapping;
interface
const
CTypesMax = 34;
CTypesMax = 35;
var
TypesPascalCTypes: array [0..CTypesMax-1] of string =
@ -50,6 +50,7 @@ var
'byte',
'Boolean32',
'PtrInt',
'cint32',
'csize_t',
'gpointer',
'cfloat',
@ -88,6 +89,7 @@ var
'guchar',
'gboolean',
'gssize',
'int32',
'size_t' ,
'gconstpointer',
'gfloat',

View File

@ -806,7 +806,11 @@ begin
BaseType := TGirBaseType(NameSpace.Types.Items[i]);
if BaseType.InheritsFrom(TgirFuzzyType) and (FuzzyType.ResolvedType = nil) then
begin
CTypesType := LookupGTypeToCType(FuzzyType.CType);
if FuzzyType.CType = '' then begin
CTypesType := LookupGTypeToCType(FuzzyType.Name);
end else begin
CTypesType := LookupGTypeToCType(FuzzyType.CType);
end;
if CTypesType <> '' then
begin
FuzzyType.TranslatedName:= CTypesType;