mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 04:19:07 +02:00
* don't complain if the external name of a complete definition and that
of a forward definition don't match, since forward definitions can't have an external name (nor can they be used in a situation where it's necessary) git-svn-id: branches/jvmbackend@18445 -
This commit is contained in:
parent
fc7725efba
commit
f1c7e018c4
@ -2164,33 +2164,38 @@ implementation
|
|||||||
(tobjectdef(ttypesym(srsym).typedef).objecttype=pd.objecttype) and
|
(tobjectdef(ttypesym(srsym).typedef).objecttype=pd.objecttype) and
|
||||||
not(oo_is_formal in tobjectdef(ttypesym(srsym).typedef).objectoptions) then
|
not(oo_is_formal in tobjectdef(ttypesym(srsym).typedef).objectoptions) then
|
||||||
begin
|
begin
|
||||||
{ the external name for the formal and the real definition must match }
|
if not(oo_is_forward in tobjectdef(ttypesym(srsym).typedef).objectoptions) then
|
||||||
if assigned(tobjectdef(ttypesym(srsym).typedef).import_lib) or
|
|
||||||
assigned(pd.import_lib) then
|
|
||||||
begin
|
begin
|
||||||
if assigned(pd.import_lib) then
|
{ the external name for the formal and the real
|
||||||
formalname:=pd.import_lib^
|
definition must match (forward declarations don't have
|
||||||
else
|
an external name set yet) }
|
||||||
formalname:='';
|
if assigned(tobjectdef(ttypesym(srsym).typedef).import_lib) or
|
||||||
formalname:=formalname+'.'+pd.objextname^;
|
assigned(pd.import_lib) then
|
||||||
if assigned(tobjectdef(ttypesym(srsym).typedef).import_lib) then
|
begin
|
||||||
foundname:=tobjectdef(ttypesym(srsym).typedef).import_lib^+'.'
|
if assigned(pd.import_lib) then
|
||||||
else
|
formalname:=pd.import_lib^
|
||||||
foundname:='';
|
else
|
||||||
foundname:=foundname+tobjectdef(ttypesym(srsym).typedef).objextname^;
|
formalname:='';
|
||||||
|
formalname:=formalname+'.'+pd.objextname^;
|
||||||
|
if assigned(tobjectdef(ttypesym(srsym).typedef).import_lib) then
|
||||||
|
foundname:=tobjectdef(ttypesym(srsym).typedef).import_lib^+'.'
|
||||||
|
else
|
||||||
|
foundname:='';
|
||||||
|
foundname:=foundname+tobjectdef(ttypesym(srsym).typedef).objextname^;
|
||||||
|
|
||||||
formalnameptr:=@formalname;
|
formalnameptr:=@formalname;
|
||||||
foundnameptr:=@foundname;
|
foundnameptr:=@foundname;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
formalnameptr:=pd.objextname;
|
formalnameptr:=pd.objextname;
|
||||||
foundnameptr:=tobjectdef(ttypesym(srsym).typedef).objextname;
|
foundnameptr:=tobjectdef(ttypesym(srsym).typedef).objextname;
|
||||||
end;
|
end;
|
||||||
if foundnameptr^<>formalnameptr^ then
|
if foundnameptr^<>formalnameptr^ then
|
||||||
begin
|
begin
|
||||||
Message2(sym_e_external_class_name_mismatch1,formalnameptr^,pd.typename);
|
Message2(sym_e_external_class_name_mismatch1,formalnameptr^,pd.typename);
|
||||||
MessagePos1(srsym.fileinfo,sym_e_external_class_name_mismatch2,foundnameptr^);
|
MessagePos1(srsym.fileinfo,sym_e_external_class_name_mismatch2,foundnameptr^);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
result:=tobjectdef(ttypesym(srsym).typedef);
|
result:=tobjectdef(ttypesym(srsym).typedef);
|
||||||
if assigned(current_procinfo) and
|
if assigned(current_procinfo) and
|
||||||
|
Loading…
Reference in New Issue
Block a user