mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 23:21:57 +02:00
* when reading ImpDef records, add '.dll' to the libname if it has no extension,
in order to be consistent with externals, declared in pascal files. The '.dll' extension will be stripped later, when generating the NewExe file. git-svn-id: trunk@42615 -
This commit is contained in:
parent
dd9c76eeec
commit
1f2354752c
@ -615,6 +615,7 @@ interface
|
||||
end;
|
||||
|
||||
function StripDllExt(const DllName:TSymStr):TSymStr;
|
||||
function MaybeAddDllExt(const DllName:TSymStr):TSymStr;
|
||||
|
||||
implementation
|
||||
|
||||
@ -2028,9 +2029,9 @@ implementation
|
||||
if not CaseSensitiveSymbols then
|
||||
SymName:=UpCase(SymName);
|
||||
if ImpDefRec.ImportByOrdinal then
|
||||
TOmfObjData(objdata).AddImportSymbol(ImpDefRec.ModuleName,'',SymName,ImpDefRec.Ordinal,false)
|
||||
TOmfObjData(objdata).AddImportSymbol(MaybeAddDllExt(ImpDefRec.ModuleName),'',SymName,ImpDefRec.Ordinal,false)
|
||||
else
|
||||
TOmfObjData(objdata).AddImportSymbol(ImpDefRec.ModuleName,ImpDefRec.Name,SymName,0,false);
|
||||
TOmfObjData(objdata).AddImportSymbol(MaybeAddDllExt(ImpDefRec.ModuleName),ImpDefRec.Name,SymName,0,false);
|
||||
Result:=True;
|
||||
ImpDefRec.Free;
|
||||
end;
|
||||
@ -4215,6 +4216,14 @@ cleanup:
|
||||
Result:=DllName;
|
||||
end;
|
||||
|
||||
function MaybeAddDllExt(const DllName: TSymStr): TSymStr;
|
||||
begin
|
||||
if ExtractFileExt(DllName)='' then
|
||||
Result:=ChangeFileExt(DllName,'.dll')
|
||||
else
|
||||
Result:=DllName;
|
||||
end;
|
||||
|
||||
{*****************************************************************************
|
||||
Initialize
|
||||
*****************************************************************************}
|
||||
|
Loading…
Reference in New Issue
Block a user