Explorar o código

* 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 -

nickysn %!s(int64=6) %!d(string=hai) anos
pai
achega
1f2354752c
Modificáronse 1 ficheiros con 11 adicións e 2 borrados
  1. 11 2
      compiler/ogomf.pas

+ 11 - 2
compiler/ogomf.pas

@@ -615,6 +615,7 @@ interface
       end;
       end;
 
 
     function StripDllExt(const DllName:TSymStr):TSymStr;
     function StripDllExt(const DllName:TSymStr):TSymStr;
+    function MaybeAddDllExt(const DllName:TSymStr):TSymStr;
 
 
 implementation
 implementation
 
 
@@ -2028,9 +2029,9 @@ implementation
         if not CaseSensitiveSymbols then
         if not CaseSensitiveSymbols then
           SymName:=UpCase(SymName);
           SymName:=UpCase(SymName);
         if ImpDefRec.ImportByOrdinal then
         if ImpDefRec.ImportByOrdinal then
-          TOmfObjData(objdata).AddImportSymbol(ImpDefRec.ModuleName,'',SymName,ImpDefRec.Ordinal,false)
+          TOmfObjData(objdata).AddImportSymbol(MaybeAddDllExt(ImpDefRec.ModuleName),'',SymName,ImpDefRec.Ordinal,false)
         else
         else
-          TOmfObjData(objdata).AddImportSymbol(ImpDefRec.ModuleName,ImpDefRec.Name,SymName,0,false);
+          TOmfObjData(objdata).AddImportSymbol(MaybeAddDllExt(ImpDefRec.ModuleName),ImpDefRec.Name,SymName,0,false);
         Result:=True;
         Result:=True;
         ImpDefRec.Free;
         ImpDefRec.Free;
       end;
       end;
@@ -4215,6 +4216,14 @@ cleanup:
           Result:=DllName;
           Result:=DllName;
       end;
       end;
 
 
+    function MaybeAddDllExt(const DllName: TSymStr): TSymStr;
+      begin
+        if ExtractFileExt(DllName)='' then
+          Result:=ChangeFileExt(DllName,'.dll')
+        else
+          Result:=DllName;
+      end;
+
 {*****************************************************************************
 {*****************************************************************************
                                   Initialize
                                   Initialize
 *****************************************************************************}
 *****************************************************************************}