소스 검색

* small fixes for double_checksum

peter 26 년 전
부모
커밋
87143b5b53
2개의 변경된 파일37개의 추가작업 그리고 12개의 파일을 삭제
  1. 30 9
      compiler/files.pas
  2. 7 3
      compiler/pmodules.pas

+ 30 - 9
compiler/files.pas

@@ -918,11 +918,25 @@ uses
          fnd:=SearchPath('.');
          if (not fnd) and assigned(current_module^.LocalUnitSearchPath) then
           fnd:=SearchPath(current_module^.LocalUnitSearchPath^);
-         if not fnd then
+         if (not fnd) then
           fnd:=SearchPath(UnitSearchPath);
+
+         { try to find a file with the first 8 chars of the modulename, like
+           dos }
+         if (not fnd) and (length(filename)>8) then
+          begin
+            filename:=copy(filename,1,8);
+            fnd:=SearchPath('.');
+            if (not fnd) and assigned(current_module^.LocalUnitSearchPath) then
+             fnd:=SearchPath(current_module^.LocalUnitSearchPath^);
+            if not fnd then
+             fnd:=SearchPath(UnitSearchPath);
+          end;
          search_unit:=fnd;
       end;
 
+
+
     procedure tmodule.reset;
 
 {$ifdef Double_checksum}
@@ -966,9 +980,16 @@ uses
         pm:=pdependent_unit(dependent_units.first);
         while assigned(pm) do
           begin
-            pm^.u^.do_reload_ppu:=true;
-            def_comment(v_warning,'Reloading '+pm^.u^.mainsource^+' needed because '+
-              mainsource^+' is reloaded');
+            if pm^.u^.in_second_compile then
+             begin
+               writeln('No reload already in second compile: ',pm^.u^.modulename^);
+             end
+            else
+             begin
+               pm^.u^.do_reload_ppu:=true;
+               def_comment(v_warning,'Reloading '+pm^.u^.modulename^+' needed because '+
+                 modulename^+' is reloaded');
+             end;
             pm:=pdependent_unit(pm^.next);
           end;
 {$endif Double_checksum}
@@ -1082,10 +1103,7 @@ uses
          _exports:=new(plinkedlist,init);
        { search the PPU file if it is an unit }
          if is_unit then
-          begin
-            if (not search_unit(modulename^,false)) and (length(modulename^)>8) then
-             search_unit(copy(modulename^,1,8),false);
-          end;
+          search_unit(modulename^,false);
       end;
 
 
@@ -1193,7 +1211,10 @@ uses
 end.
 {
   $Log$
-  Revision 1.91  1999-04-21 09:43:36  peter
+  Revision 1.92  1999-04-25 15:08:36  peter
+    * small fixes for double_checksum
+
+  Revision 1.91  1999/04/21 09:43:36  peter
     * storenumber works
     * fixed some typos in double_checksum
     + incompatible types type1 and type2 message (with storenumber)

+ 7 - 3
compiler/pmodules.pas

@@ -521,9 +521,10 @@ writeln('loaded intfc: ',loaded_unit^.interface_crc,' pu intfc ',pu^.interface_c
                   { try to load the unit a second time first }
                   current_module:=hp;
                   current_module^.in_second_compile:=true;
-                { now realy load the ppu }
+                  { now realy load the ppu }
+                  current_ppu:=current_module^.ppufile;
                   loadppufile;
-                { set compiled flag }
+                  { set compiled flag }
                   current_module^.compiled:=true;
                 end;
 {$else Double_Checksum}
@@ -1397,7 +1398,10 @@ writeln('loaded intfc: ',loaded_unit^.interface_crc,' pu intfc ',pu^.interface_c
 end.
 {
   $Log$
-  Revision 1.111  1999-04-21 09:43:46  peter
+  Revision 1.112  1999-04-25 15:08:38  peter
+    * small fixes for double_checksum
+
+  Revision 1.111  1999/04/21 09:43:46  peter
     * storenumber works
     * fixed some typos in double_checksum
     + incompatible types type1 and type2 message (with storenumber)