Browse Source

+ when trying to find source files of a ppufile
check the includepathlist for included files
the main file must still be in the same directory

pierre 27 years ago
parent
commit
e500f85308
2 changed files with 30 additions and 8 deletions
  1. 24 5
      compiler/files.pas
  2. 6 3
      compiler/tree.pas

+ 24 - 5
compiler/files.pas

@@ -339,6 +339,7 @@ unit files;
          count   : longint;
          count   : longint;
          temp,hs : string;
          temp,hs : string;
          b       : byte;
          b       : byte;
+         incfile_found : boolean;
          code    : word;
          code    : word;
          objfiletime,
          objfiletime,
          ppufiletime,
          ppufiletime,
@@ -413,6 +414,7 @@ unit files;
        begin
        begin
          ppufile^.read_data(hs[0],1,count);
          ppufile^.read_data(hs[0],1,count);
          ppufile^.read_data(hs[1],ord(hs[0]),count);
          ppufile^.read_data(hs[1],ord(hs[0]),count);
+         ppufile^.read_data(b,1,count);
          if (flags and uf_in_library)<>0 then
          if (flags and uf_in_library)<>0 then
           begin
           begin
             sources_avail:=false;
             sources_avail:=false;
@@ -422,6 +424,19 @@ unit files;
           begin
           begin
             { check the date of the source files }
             { check the date of the source files }
             Source_Time:=GetNamedFileTime(unit_path+hs);
             Source_Time:=GetNamedFileTime(unit_path+hs);
+            if Source_Time=-1 then
+              begin
+                 { search for include files in the includepathlist }
+                 if b<>ibend then
+                   temp:=search(hs,includesearchpath,incfile_found);
+                 if incfile_found then
+                   begin
+                      hs:=temp+hs;
+                      Source_Time:=GetNamedFileTime(hs);
+                   end;
+              end
+            else
+              hs:=unit_path+hs;
             if Source_Time=-1 then
             if Source_Time=-1 then
              begin
              begin
                sources_avail:=false;
                sources_avail:=false;
@@ -437,18 +452,17 @@ unit files;
                 end;
                 end;
              end;
              end;
           end;
           end;
-         Message1(unit_t_ppu_source,unit_path+hs+temp);
+         Message1(unit_t_ppu_source,hs+temp);
 {$ifdef UseBrowser}
 {$ifdef UseBrowser}
-         fsplit(unit_path+hs,_d,_n,_e);
+         fsplit(hs,_d,_n,_e);
          new(hp,init(_d,_n,_e));
          new(hp,init(_d,_n,_e));
          { the indexing should match what is done in writeasunit }
          { the indexing should match what is done in writeasunit }
          sourcefiles.register_file(hp);
          sourcefiles.register_file(hp);
 {$endif UseBrowser}
 {$endif UseBrowser}
-         ppufile^.read_data(b,1,count);
        end;
        end;
     { main source is always the last }
     { main source is always the last }
       stringdispose(mainsource);
       stringdispose(mainsource);
-      mainsource:=stringdup(ppufile^.path^+hs);
+      mainsource:=stringdup(hs);
 
 
     { check the object and assembler file if not a library }
     { check the object and assembler file if not a library }
       if (flags and uf_smartlink)<>0 then
       if (flags and uf_smartlink)<>0 then
@@ -646,7 +660,12 @@ unit files;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.8  1998-05-04 17:54:25  peter
+  Revision 1.9  1998-05-06 15:04:20  pierre
+    + when trying to find source files of a ppufile
+      check the includepathlist for included files
+      the main file must still be in the same directory
+
+  Revision 1.8  1998/05/04 17:54:25  peter
     + smartlinking works (only case jumptable left todo)
     + smartlinking works (only case jumptable left todo)
     * redesign of systems.pas to support assemblers and linkers
     * redesign of systems.pas to support assemblers and linkers
     + Unitname is now also in the PPU-file, increased version to 14
     + Unitname is now also in the PPU-file, increased version to 14

+ 6 - 3
compiler/tree.pas

@@ -295,7 +295,6 @@ unit tree;
 
 
   implementation
   implementation
 
 
-{$ifdef UseTokenInfo}
 {$ifdef extdebug}
 {$ifdef extdebug}
     uses
     uses
        types,pbase;
        types,pbase;
@@ -303,7 +302,6 @@ unit tree;
     uses
     uses
        pbase;
        pbase;
 {$endif extdebug}
 {$endif extdebug}
-{$endif UseTokenInfo}
 
 
 {****************************************************************************
 {****************************************************************************
         this is a pool for the tree nodes to get more performance
         this is a pool for the tree nodes to get more performance
@@ -1524,7 +1522,12 @@ unit tree;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  1998-05-06 08:38:52  pierre
+  Revision 1.7  1998-05-06 15:04:21  pierre
+    + when trying to find source files of a ppufile
+      check the includepathlist for included files
+      the main file must still be in the same directory
+
+  Revision 1.6  1998/05/06 08:38:52  pierre
     * better position info with UseTokenInfo
     * better position info with UseTokenInfo
       UseTokenInfo greatly simplified
       UseTokenInfo greatly simplified
     + added check for changed tree after first time firstpass
     + added check for changed tree after first time firstpass