Browse Source

* tempclosing of ppufiles under dos was wrong

pierre 26 years ago
parent
commit
c2abde1296
2 changed files with 26 additions and 12 deletions
  1. 13 7
      compiler/pmodules.pas
  2. 13 5
      compiler/ppu.pas

+ 13 - 7
compiler/pmodules.pas

@@ -22,10 +22,13 @@
 }
 unit pmodules;
             { close old_current_ppu on system that are
-              short on file handles like DOS PM }
-{$ifdef DOS}
+              short on file handles like DOS system PM }
+{$ifdef GO32V1}
+{$define SHORT_ON_FILE_HANDLES}
+{$endif GO32V1}
+{$ifdef GO32V2}
 {$define SHORT_ON_FILE_HANDLES}
-{$endif DOS}
+{$endif GO32V2}
 
 {$define New_GDB}
 
@@ -586,7 +589,7 @@ unit pmodules;
           end;
          { set the old module }
 {$ifdef SHORT_ON_FILE_HANDLES}
-         old_current_ppu^.tempreopen;
+         old_current_ppu^.tempopen;
 {$endif SHORT_ON_FILE_HANDLES}
          current_ppu:=old_current_ppu;
          current_module:=old_current_module;
@@ -1211,12 +1214,12 @@ unit pmodules;
   {$ifndef Dont_use_double_checksum}
          if not(cs_compilesystem in aktmoduleswitches) then
            if store_interface_crc<>current_module^.interface_crc then
-             Def_comment(V_Warning,current_module^.ppufilename^+' Interface CRC changed '+
+             Do_comment(V_Warning,current_module^.ppufilename^+' Interface CRC changed '+
                tostr(store_crc)+'<>'+tostr(current_module^.interface_crc));
   {$ifdef EXTDEBUG}
          if not(cs_compilesystem in aktmoduleswitches) then
            if (store_crc<>current_module^.crc) and simplify_ppu then
-             Def_comment(V_Warning,current_module^.ppufilename^+' implementation CRC changed '+
+             Do_comment(V_Warning,current_module^.ppufilename^+' implementation CRC changed '+
                tostr(store_crc)+'<>'+tostr(current_module^.interface_crc));
   {$endif EXTDEBUG}
   {$endif ndef Dont_use_Double_checksum}
@@ -1449,7 +1452,10 @@ unit pmodules;
 end.
 {
   $Log$
-  Revision 1.149  1999-08-28 15:34:19  florian
+  Revision 1.150  1999-08-30 16:21:40  pierre
+   * tempclosing of ppufiles under dos was wrong
+
+  Revision 1.149  1999/08/28 15:34:19  florian
     * bug 519 fixed
 
   Revision 1.148  1999/08/27 14:53:00  pierre

+ 13 - 5
compiler/ppu.pas

@@ -189,7 +189,8 @@ type
     entryidx : longint;
     entry    : tppuentry;
     entrytyp : byte;
-    closed   : boolean;
+    closed,
+    tempclosed : boolean;
     closepos : longint;
     constructor init(fn:string);
     destructor  done;
@@ -338,6 +339,7 @@ begin
   NewHeader;
   Error:=false;
   closed:=true;
+  tempclosed:=false;
   getmem(buf,ppubufsize);
 end;
 
@@ -852,7 +854,7 @@ begin
        begin
          if (crcindex2<crc_array_size) and (crcindex2<crc_index2) and
             (crc_test2^[crcindex2]<>crc) then
-           Def_comment(V_Warning,'impl CRC changed');
+           Do_comment(V_Warning,'impl CRC changed');
 {$ifdef Test_Double_checksum_write}
          Writeln(CRCFile,crc);
 {$endif Test_Double_checksum_write}
@@ -876,7 +878,7 @@ begin
           begin
             if (crcindex<crc_array_size) and (crcindex<crc_index) and
                (crc_test^[crcindex]<>interface_crc) then
-              Def_comment(V_Warning,'CRC changed');
+              Do_comment(V_Warning,'CRC changed');
 {$ifdef Test_Double_checksum_write}
             Writeln(CRCFile,interface_crc);
 {$endif Test_Double_checksum_write}
@@ -952,6 +954,7 @@ end;
            {$I+}
            i:=ioresult;
            closed:=true;
+           tempclosed:=true;
          end;
       end;
 
@@ -961,7 +964,7 @@ end;
         ofm : byte;
       begin
         tempopen:=false;
-        if not closed then
+        if not closed or not tempclosed then
          exit;
         ofm:=filemode;
         filemode:=0;
@@ -972,6 +975,8 @@ end;
         if ioresult<>0 then
          exit;
         closed:=false;
+        tempclosed:=false;
+        
       { restore state }
         seek(f,closepos);
         tempopen:=true;
@@ -980,7 +985,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.40  1999-08-27 10:48:40  pierre
+  Revision 1.41  1999-08-30 16:21:40  pierre
+   * tempclosing of ppufiles under dos was wrong
+
+  Revision 1.40  1999/08/27 10:48:40  pierre
     + tppufile.tempclose and tempopen added
     * some changes so that nothing is writtedn to disk while
       calculating CRC only