浏览代码

* use SysUtils unit instead of Dos Unit

mazen 21 年之前
父节点
当前提交
4e2e51c4b1
共有 3 个文件被更改,包括 51 次插入15 次删除
  1. 22 5
      compiler/finput.pas
  2. 14 5
      compiler/fmodule.pas
  3. 15 5
      compiler/impdef.pas

+ 22 - 5
compiler/finput.pas

@@ -162,11 +162,11 @@ interface
 implementation
 implementation
 
 
 uses
 uses
-{$ifdef Delphi}
-  dmisc,
-{$else Delphi}
+{$IFDEF USE_SYSUTILS}
+  SysUtils,
+{$ELSE USE_SYSUTILS}
   dos,
   dos,
-{$endif Delphi}
+{$ENDIF USE_SYSUTILS}
 {$ifdef heaptrc}
 {$ifdef heaptrc}
   fmodule,
   fmodule,
   ppheap,
   ppheap,
@@ -179,14 +179,22 @@ uses
  ****************************************************************************}
  ****************************************************************************}
 
 
     constructor tinputfile.create(const fn:string);
     constructor tinputfile.create(const fn:string);
+{$IFDEF USE_SYSUTILS}
+{$ELSE USE_SYSUTILS}
       var
       var
         p:dirstr;
         p:dirstr;
         n:namestr;
         n:namestr;
         e:extstr;
         e:extstr;
+{$ENDIF USE_SYSUTILS}
       begin
       begin
+{$IFDEF USE_SYSUTILS}
+        name:=stringdup(SplitFileName(fn));
+        path:=stringdupSplitPath(fn));
+{$ELSE USE_SYSUTILS}
         FSplit(fn,p,n,e);
         FSplit(fn,p,n,e);
         name:=stringdup(n+e);
         name:=stringdup(n+e);
         path:=stringdup(p);
         path:=stringdup(p);
+{$ENDIF USE_SYSUTILS}
         next:=nil;
         next:=nil;
         filetime:=-1;
         filetime:=-1;
       { file info }
       { file info }
@@ -631,7 +639,13 @@ uses
          { Create names }
          { Create names }
          paramfn := stringdup(fn);
          paramfn := stringdup(fn);
          paramallowoutput := allowoutput;
          paramallowoutput := allowoutput;
+{$IFDEF USE_SYSUTILS}
+         p := SplitPath(fn);
+         n := SplitName(fn);
+         e := SplitExtension(fn);
+{$ELSE USE_SYSUTILS}
          fsplit(fn,p,n,e);
          fsplit(fn,p,n,e);
+{$ENDIF USE_SYSUTILS}
          n:=FixFileName(n);
          n:=FixFileName(n);
          { set path }
          { set path }
          path:=stringdup(FixPath(p,false));
          path:=stringdup(FixPath(p,false));
@@ -726,7 +740,10 @@ uses
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.26  2004-08-02 07:15:54  michael
+  Revision 1.27  2004-10-14 17:26:04  mazen
+  * use SysUtils unit instead of Dos Unit
+
+  Revision 1.26  2004/08/02 07:15:54  michael
   + Patch from Christian Iversen to implement  LIBPREFIX/SUFFIX/EXTENSION directives
   + Patch from Christian Iversen to implement  LIBPREFIX/SUFFIX/EXTENSION directives
 
 
   Revision 1.25  2004/06/20 08:55:29  florian
   Revision 1.25  2004/06/20 08:55:29  florian

+ 14 - 5
compiler/fmodule.pas

@@ -173,11 +173,11 @@ function get_source_file(moduleindex,fileindex : longint) : tinputfile;
 implementation
 implementation
 
 
     uses
     uses
-    {$ifdef delphi}
-      dmisc,
-    {$else}
+    {$IFDEF USE_SYSUTILS}
+      SysUtils,
+    {$ELSE USE_SYSUTILS}
       dos,
       dos,
-    {$endif}
+    {$ENDIF USE_SYSUTILS}
       verbose,systems,
       verbose,systems,
       scanner,
       scanner,
       procinfo;
       procinfo;
@@ -348,7 +348,13 @@ implementation
         n : namestr;
         n : namestr;
         e : extstr;
         e : extstr;
       begin
       begin
+    {$IFDEF USE_SYSUTILS}
+        p := SplitPath(s);
+        n := SplitName(s);
+        e := SplitExtension(s);
+    {$ELSE USE_SYSUTILS}
         FSplit(s,p,n,e);
         FSplit(s,p,n,e);
+    {$ENDIF USE_SYSUTILS}
         { Programs have the name 'Program' to don't conflict with dup id's }
         { Programs have the name 'Program' to don't conflict with dup id's }
         if _is_unit then
         if _is_unit then
          inherited create(n)
          inherited create(n)
@@ -694,7 +700,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.46  2004-08-30 20:23:33  peter
+  Revision 1.47  2004-10-14 17:30:09  mazen
+  * use SysUtils unit instead of Dos Unit
+
+  Revision 1.46  2004/08/30 20:23:33  peter
     * use realmodulename in unit not used msg
     * use realmodulename in unit not used msg
 
 
   Revision 1.45  2004/06/20 08:55:29  florian
   Revision 1.45  2004/06/20 08:55:29  florian

+ 15 - 5
compiler/impdef.pas

@@ -32,12 +32,11 @@ unit impdef;
 interface
 interface
 
 
    uses
    uses
-   {$ifdef Delphi}
+   {$IFDEF USE_SYSUTILS}
      SysUtils,
      SysUtils,
-     Dmisc;
-   {$else}
+   {$ELSE USE_SYSUTILS}
      Dos;
      Dos;
-   {$endif}
+   {$ENDIF USE_SYSUTILS}
 
 
    var
    var
      as_name,
      as_name,
@@ -175,7 +174,11 @@ procedure CreateTempDir(const s:string);
  end;
  end;
 procedure call_as(const name:string);
 procedure call_as(const name:string);
  begin
  begin
+{$IFDEF USE_SYSUTILS}
+  ExecuteProcess(as_name,'-o '+name+'o '+name);
+{$ELSE USE_SYSUTILS}
   exec(as_name,'-o '+name+'o '+name);
   exec(as_name,'-o '+name+'o '+name);
+{$ENDIF USE_SYSUTILS}
  end;
  end;
 procedure call_ar;
 procedure call_ar;
  var
  var
@@ -190,7 +193,11 @@ procedure call_ar;
   GetFAttr(f,attr);
   GetFAttr(f,attr);
   If DOSError=0 then
   If DOSError=0 then
    erase(f);
    erase(f);
+{$IFDEF USE_SYSUTILS}
+  ExecuteProcess(ar_name,'rs '+impname+' '+path+dirsep+'*.swo');
+{$ELSE USE_SYSUTILS}
   exec(ar_name,'rs '+impname+' '+path+dirsep+'*.swo');
   exec(ar_name,'rs '+impname+' '+path+dirsep+'*.swo');
+{$ENDIF USE_SYSUTILS}
   cleardir(path,'*.sw');
   cleardir(path,'*.sw');
   cleardir(path,'*.swo');
   cleardir(path,'*.swo');
   {$i-}
   {$i-}
@@ -478,7 +485,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.14  2004-06-20 08:55:29  florian
+  Revision 1.15  2004-10-14 17:33:29  mazen
+  * use SysUtils unit instead of Dos Unit
+
+  Revision 1.14  2004/06/20 08:55:29  florian
     * logs truncated
     * logs truncated
 
 
   Revision 1.13  2004/02/22 14:52:59  hajny
   Revision 1.13  2004/02/22 14:52:59  hajny