From 1f2354752ccda1d531faef430b0094daf6c66869 Mon Sep 17 00:00:00 2001 From: nickysn Date: Fri, 9 Aug 2019 14:27:11 +0000 Subject: [PATCH] * 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 - --- compiler/ogomf.pas | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/compiler/ogomf.pas b/compiler/ogomf.pas index 51850f63b4..f5944c3803 100644 --- a/compiler/ogomf.pas +++ b/compiler/ogomf.pas @@ -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 *****************************************************************************}