Browse Source

* fixed path appending for lib

peter 23 năm trước cách đây
mục cha
commit
2e96721c20
2 tập tin đã thay đổi với 50 bổ sung9 xóa
  1. 10 1
      compiler/link.pas
  2. 40 8
      compiler/ncal.pas

+ 10 - 1
compiler/link.pas

@@ -149,17 +149,23 @@ end;
 function FindLibraryFile(s:string;const prefix,ext:string;var foundfile : string) : boolean;
 var
   found : boolean;
+  paths : string;
 begin
   findlibraryfile:=false;
   foundfile:=s;
   if s='' then
    exit;
+  { split path from filename }
+  paths:=SplitPath(s);
+  s:=SplitFileName(s);
   { add prefix 'lib' }
   if (prefix<>'') and (Copy(s,1,length(prefix))<>prefix) then
    s:=prefix+s;
   { add extension }
   if (ext<>'') and (Copy(s,length(s)-length(ext)+1,length(ext))<>ext) then
    s:=s+ext;
+  { readd the split path }
+  s:=paths+s;
   if FileExists(s) then
    begin
      foundfile:=ScriptFixFileName(s);
@@ -533,7 +539,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.24  2001-09-18 11:30:48  michael
+  Revision 1.25  2002-01-19 11:57:05  peter
+    * fixed path appending for lib
+
+  Revision 1.24  2001/09/18 11:30:48  michael
   * Fixes win32 linking problems with import libraries
   * LINKLIB Libraries are now looked for using C file extensions
   * get_exepath fix

+ 40 - 8
compiler/ncal.pas

@@ -852,14 +852,12 @@ implementation
               if not(assigned(procdefinition)) then
                 begin
                    { when the definition has overload directive set, we search for
-                      overloaded definitions }
+                     overloaded definitions in the class, this only needs to be done once
+                     for class entries as the tree keeps always the same }
                    if (not symtableprocentry.overloadchecked) and
-                      (po_overload in symtableprocentry.defs^.def.procoptions) then
-                    begin
-                      { for methods search in the class tree }
-                      if (symtableprocentry.owner.symtabletype=objectsymtable) then
-                        search_class_overloads(symtableprocentry);
-                    end;
+                      (po_overload in symtableprocentry.defs^.def.procoptions) and
+                      (symtableprocentry.owner.symtabletype=objectsymtable) then
+                    search_class_overloads(symtableprocentry);
 
                    { link all procedures which have the same # of parameters }
                    pd:=symtableprocentry.defs;
@@ -888,6 +886,37 @@ implementation
                         pd:=pd^.next;
                      end;
 
+{$ifdef CROSSUNIT}
+                   { when the definition has overload directive set, we search for
+                     overloaded definitions in the other used units unitsymtable. The found
+                     entries are only added to the procs list and not the procsym }
+                   if (po_overload in symtableprocentry.defs^.def.procoptions) and
+                      (symtableprocentry.owner.symtabletype<>objectsymtable) then
+                     begin
+
+
+                 srpdl:=srsym.defs;
+                 while assigned(srpdl) do
+                  begin
+                    found:=false;
+                    pdl:=aprocsym.defs;
+                    while assigned(pdl) do
+                     begin
+                       if equal_paras(pdl^.def.para,srpdl^.def.para,cp_value_equal_const) then
+                        begin
+                          found:=true;
+                          break;
+                        end;
+                       pdl:=pdl^.next;
+                     end;
+                    if not found then
+                     aprocsym.addprocdef(srpdl^.def);
+                    srpdl:=srpdl^.next;
+                  end;
+
+                     end;
+{$endif CROSSUNIT}
+
                    { no procedures found? then there is something wrong
                      with the parameter size }
                    if not assigned(procs) then
@@ -1753,7 +1782,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.61  2001-12-31 16:59:41  peter
+  Revision 1.62  2002-01-19 11:57:05  peter
+    * fixed path appending for lib
+
+  Revision 1.61  2001/12/31 16:59:41  peter
     * protected/private symbols parsing fixed
 
   Revision 1.60  2001/12/11 13:21:36  jonas