Răsfoiți Sursa

* always add library prefix and suffix to generate uniform dll name

git-svn-id: trunk@3285 -
peter 19 ani în urmă
părinte
comite
76534b1888
2 a modificat fișierele cu 8 adăugiri și 1 ștergeri
  1. 7 1
      compiler/pdecsub.pas
  2. 1 0
      compiler/utils/ppudump.pp

+ 7 - 1
compiler/pdecsub.pas

@@ -1444,6 +1444,8 @@ procedure pd_external(pd:tabstractprocdef);
   that case either import_nr<>0 or import_name<>nil is true, so
   the procedure is either imported by number or by name. (DM)
 }
+var
+  hs : string;
 begin
   if pd.deftype<>procdef then
     internalerror(2003042615);
@@ -1459,7 +1461,11 @@ begin
         follow (FK) }
       if not(token=_SEMICOLON) and not(idtoken=_NAME) then
         begin
-          import_dll:=stringdup(get_stringconst);
+          { Always add library prefix and suffix to create an uniform name }
+          hs:=AddExtension(get_stringconst,target_info.sharedlibext);
+          if Copy(hs,1,length(target_info.sharedlibprefix))<>target_info.sharedlibprefix then
+            hs:=target_info.sharedlibprefix+hs;
+          import_dll:=stringdup(hs);
           include(procoptions,po_has_importdll);
           if (idtoken=_NAME) then
            begin

+ 1 - 0
compiler/utils/ppudump.pp

@@ -1703,6 +1703,7 @@ begin
                writeln(space,'       Import DLL : ',getstring);
              if (po_has_importname in procoptions) then
                writeln(space,'      Import Name : ',getstring);
+             writeln(space,'      Import Nr : ',getword);
              if (po_inline in procoptions) then
               begin
                 write  (space,'       FuncretSym : ');