mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 10:10:36 +02:00
* pas2jni: Fixed string constant handling after recent changes in FPC.
git-svn-id: trunk@34275 -
This commit is contained in:
parent
3a2dd2d6e1
commit
d99f913836
@ -1170,19 +1170,30 @@ begin
|
|||||||
s:='double';
|
s:='double';
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
s:=DefToJavaType(d.VarType);
|
s:='';
|
||||||
if d.VarType.DefType = dtType then
|
case d.VarType.DefType of
|
||||||
case TTypeDef(d.VarType).BasicType of
|
dtType:
|
||||||
btLongWord, btInt64:
|
case TTypeDef(d.VarType).BasicType of
|
||||||
v:=v + 'L';
|
btLongWord, btInt64:
|
||||||
btBoolean:
|
v:=v + 'L';
|
||||||
if v = '1' then
|
btBoolean:
|
||||||
v:='true'
|
if v = '1' then
|
||||||
else
|
v:='true'
|
||||||
v:='false';
|
else
|
||||||
end;
|
v:='false';
|
||||||
|
end;
|
||||||
|
dtArray:
|
||||||
|
with TArrayDef(d.VarType) do
|
||||||
|
if (ElType.DefType = dtType) and (TTypeDef(ElType).BasicType in [btChar, btWideChar]) then
|
||||||
|
s:='String';
|
||||||
|
end;
|
||||||
|
if s = '' then
|
||||||
|
s:=DefToJavaType(d.VarType);
|
||||||
end;
|
end;
|
||||||
Fjs.WriteLn(Format('public static final %s %s = %s;', [s, d.Name, v]));
|
v:=Format('public static final %s %s = %s;', [s, d.Name, v]);
|
||||||
|
if s = SUnsupportedType then
|
||||||
|
v:='// ' + v;
|
||||||
|
Fjs.WriteLn(v);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWriter.WriteEnum(d: TDef);
|
procedure TWriter.WriteEnum(d: TDef);
|
||||||
|
Loading…
Reference in New Issue
Block a user