mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 06:09:11 +02:00
* fixed error in r19248 whereby the namespace for automatically generated
classes was no longer set afterwards (and the new code is also much simpler) git-svn-id: branches/jvmbackend@19554 -
This commit is contained in:
parent
cf47b8d422
commit
2d7e674168
@ -417,22 +417,13 @@ implementation
|
|||||||
hs:=ChangeFileExt(hs,target_info.sharedlibext);
|
hs:=ChangeFileExt(hs,target_info.sharedlibext);
|
||||||
if Copy(hs,1,length(target_info.sharedlibprefix))<>target_info.sharedlibprefix then
|
if Copy(hs,1,length(target_info.sharedlibprefix))<>target_info.sharedlibprefix then
|
||||||
hs:=target_info.sharedlibprefix+hs;
|
hs:=target_info.sharedlibprefix+hs;
|
||||||
end
|
|
||||||
else if assigned(current_module.namespace) then
|
|
||||||
begin
|
|
||||||
{ import_lib is used to specify the package name for the JVM
|
|
||||||
target (= namespace) }
|
|
||||||
if (target_info.system=system_jvm_java32) and
|
|
||||||
assigned(current_module.namespace) then
|
|
||||||
hs:=current_module.namespace^;
|
|
||||||
{ not sure how to deal with cppclass here, since namespaces
|
|
||||||
mean something different there }
|
|
||||||
end;
|
end;
|
||||||
if hs<>'' then
|
if hs<>'' then
|
||||||
begin
|
begin
|
||||||
{ the JVM expects java/lang/Object rather than java.lang.Object }
|
{ the JVM expects java/lang/Object rather than java.lang.Object }
|
||||||
if target_info.system=system_jvm_java32 then
|
if target_info.system=system_jvm_java32 then
|
||||||
Replace(hs,'.','/');
|
Replace(hs,'.','/');
|
||||||
|
stringdispose(od.import_lib);
|
||||||
od.import_lib:=stringdup(hs);
|
od.import_lib:=stringdup(hs);
|
||||||
end;
|
end;
|
||||||
include(od.objectoptions, oo_is_external);
|
include(od.objectoptions, oo_is_external);
|
||||||
@ -446,15 +437,6 @@ implementation
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
od.objextname:=stringdup(od.objrealname^);
|
od.objextname:=stringdup(od.objrealname^);
|
||||||
{ ToDo for cpp: read/set the namespace of the class (influences the mangled name)
|
|
||||||
(notice that for the JVM target, there is no difference between
|
|
||||||
the namespace and import_lib) }
|
|
||||||
if (target_info.system=system_jvm_java32) and
|
|
||||||
assigned(current_module.namespace) then
|
|
||||||
begin
|
|
||||||
od.import_lib:=stringdup(current_module.namespace^);
|
|
||||||
Replace(od.import_lib^,'.','/');
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -3022,6 +3022,11 @@ implementation
|
|||||||
objname:=stringdup(upper(n));
|
objname:=stringdup(upper(n));
|
||||||
objrealname:=stringdup(n);
|
objrealname:=stringdup(n);
|
||||||
objectoptions:=[];
|
objectoptions:=[];
|
||||||
|
if assigned(current_module.namespace) then
|
||||||
|
begin
|
||||||
|
import_lib:=stringdup(current_module.namespace^);
|
||||||
|
replace(import_lib^,'.','/');
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor tabstractrecorddef.ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
|
constructor tabstractrecorddef.ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
|
||||||
|
Loading…
Reference in New Issue
Block a user