2
0
Эх сурвалжийг харах

* make win32 compile

git-svn-id: trunk@5103 -
peter 19 жил өмнө
parent
commit
9f5d69ce31

+ 6 - 35
compiler/cfileutils.pas

@@ -28,6 +28,12 @@ unit cfileutils;
 interface
 
     uses
+{$ifdef hasunix}
+      Baseunix,unix,
+{$endif hasunix}
+{$ifdef win32}
+      Windows,
+{$endif win32}
 {$IFNDEF USE_FAKE_SYSUTILS}
       SysUtils,
 {$ELSE}
@@ -88,10 +94,7 @@ interface
     Function  PathExists ( F : String) : Boolean;
     Function  FileExists ( Const F : String) : Boolean;
     function  FileExistsNonCase(const path,fn:string;var foundfile:string):boolean;
-    Function  RemoveFile(const f:string):boolean;
     Function  RemoveDir(d:string):boolean;
-    Function  GetFileTime ( Var F : File) : Longint;
-    {Extracts the path without its filename, from a path.}
     Function  FixPath(s:string;allowdot:boolean):string;
     function  FixFileName(const s:string):string;
     function  TargetFixPath(s:string;allowdot:boolean):string;
@@ -109,9 +112,6 @@ interface
 implementation
 
     uses
-{$ifdef hasunix}
-      Baseunix,unix,
-{$endif}
       Comphook,
       Globals;
 
@@ -435,18 +435,6 @@ implementation
       end;
 
 
-    Function RemoveFile(const f:string):boolean;
-      var
-        g : file;
-      begin
-        assign(g,f);
-        {$I-}
-         erase(g);
-        {$I+}
-        RemoveFile:=(ioresult=0);
-      end;
-
-
     Function RemoveDir(d:string):boolean;
       begin
         if d[length(d)]=source_info.DirSep then
@@ -930,23 +918,6 @@ implementation
      end;
 
 
-   Function GetFileTime ( Var F : File) : Longint;
-     Var
-     {$ifdef hasunix}
-        info: Stat;
-     {$endif}
-       L : longint;
-     begin
-     {$ifdef hasunix}
-      FPFStat (F,Info);
-      L:=Info.st_Mtime;
-     {$else}
-       GetFTime(f,l);
-     {$endif}
-       GetFileTime:=L;
-     end;
-
-
    function FindFile(const f : string;path : string;var foundfile:string):boolean;
       Var
         singlepathstring : string;

+ 1 - 1
compiler/globals.pas

@@ -513,7 +513,7 @@ implementation
       var
         comspec : string;
       begin
-        comspec:=getenv('COMSPEC');
+        comspec:=GetEnvironmentVariable('COMSPEC');
         result := ExecuteProcess(comspec,' /C '+command);
       end;
    {$endif amigashell}

+ 3 - 3
compiler/link.pas

@@ -666,7 +666,7 @@ Implementation
       begin
         MakeStaticLibrary:=false;
       { remove the library, to be sure that it is rewritten }
-        RemoveFile(current_module.staticlibfilename^);
+        DeleteFile(current_module.staticlibfilename^);
       { Call AR }
         smartpath:=current_module.outputpath^+FixPath(ChangeFileExt(current_module.asmfilename^,target_info.smartext),false);
         SplitBinCmd(target_ar.arcmd,binstr,cmdstr);
@@ -722,9 +722,9 @@ Implementation
          if not(cs_link_nolink in current_settings.globalswitches) then
           begin
             while not SmartLinkOFiles.Empty do
-              RemoveFile(SmartLinkOFiles.GetFirst);
+              DeleteFile(SmartLinkOFiles.GetFirst);
             if scripted_ar then
-              RemoveFile(scriptfile);
+              DeleteFile(scriptfile);
             RemoveDir(smartpath);
           end
          else

+ 1 - 1
compiler/systems/t_amiga.pas

@@ -228,7 +228,7 @@ begin
 
   { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-    RemoveFile(outputexedir+Info.ResName);
+    DeleteFile(outputexedir+Info.ResName);
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;

+ 2 - 2
compiler/systems/t_beos.pas

@@ -398,7 +398,7 @@ begin
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;
@@ -458,7 +458,7 @@ var
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
   MakeSharedLibrary:=success;   { otherwise a recursive call to link method }
 end;

+ 2 - 2
compiler/systems/t_bsd.pas

@@ -548,7 +548,7 @@ begin
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;
@@ -599,7 +599,7 @@ begin
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
   MakeSharedLibrary:=success;   { otherwise a recursive call to link method }
 end;

+ 1 - 1
compiler/systems/t_emx.pas

@@ -513,7 +513,7 @@ begin
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;

+ 1 - 1
compiler/systems/t_gba.pas

@@ -541,7 +541,7 @@ begin
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
 { Post process }
   if success then

+ 2 - 2
compiler/systems/t_go32v2.pas

@@ -264,8 +264,8 @@ begin
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
    begin
-     RemoveFile(outputexedir+Info.ResName);
-     RemoveFile(outputexedir+Info.ScriptName);
+     DeleteFile(outputexedir+Info.ResName);
+     DeleteFile(outputexedir+Info.ScriptName);
    end;
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }

+ 2 - 2
compiler/systems/t_linux.pas

@@ -640,7 +640,7 @@ begin
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
   if (success) then
     success:=PostProcessExecutable(current_module.exefilename^,false);
@@ -693,7 +693,7 @@ begin
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
   MakeSharedLibrary:=success;   { otherwise a recursive call to link method }
 end;

+ 1 - 1
compiler/systems/t_macos.pas

@@ -233,7 +233,7 @@ begin
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-    RemoveFile(outputexedir+Info.ResName);
+    DeleteFile(outputexedir+Info.ResName);
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;

+ 1 - 1
compiler/systems/t_morph.pas

@@ -252,7 +252,7 @@ begin
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 

+ 4 - 4
compiler/systems/t_nwl.pas

@@ -581,7 +581,7 @@ begin
 
   { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-    RemoveFile(outputexedir+Info.ResName);
+    DeleteFile(outputexedir+Info.ResName);
 
 { Call nlmconv }
   if success then
@@ -594,11 +594,11 @@ begin
     success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
     if (success) and not(cs_link_nolink in current_settings.globalswitches) then
     begin
-      RemoveFile(outputexedir+'n'+Info.ResName);
-      RemoveFile(outputexedir+tmpLinkFileName);
+      DeleteFile(outputexedir+'n'+Info.ResName);
+      DeleteFile(outputexedir+tmpLinkFileName);
       if not xdcpresent then
         if usexdc then
-          RemoveFile (xdcname);
+          DeleteFile (xdcname);
     end;
   end;
 

+ 4 - 3
compiler/systems/t_nwm.pas

@@ -92,6 +92,7 @@ interface
 implementation
 
   uses
+    SysUtils,
     cutils,cfileutils,
     verbose,systems,globtype,globals,
     symconst,script,
@@ -524,7 +525,7 @@ begin
 
   { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-    RemoveFile(outputexedir+Info.ResName);
+    DeleteFile(outputexedir+Info.ResName);
 
 { Call nlmconv }
   if success then
@@ -537,8 +538,8 @@ begin
     success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
     if (success) and not(cs_link_nolink in current_settings.globalswitches) then
     begin
-      RemoveFile(outputexedir+'n'+Info.ResName);
-      RemoveFile(outputexedir+tmpLinkFileName);
+      DeleteFile(outputexedir+'n'+Info.ResName);
+      DeleteFile(outputexedir+tmpLinkFileName);
     end;
   end;
 

+ 1 - 1
compiler/systems/t_os2.pas

@@ -511,7 +511,7 @@ begin
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;

+ 1 - 1
compiler/systems/t_palmos.pas

@@ -195,7 +195,7 @@ begin
 
   { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;

+ 2 - 2
compiler/systems/t_sunos.pas

@@ -407,7 +407,7 @@ begin
 { Remove ReponseFile }
 {$IFNDEF LinkTest}
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 {$ENDIF}
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;
@@ -444,7 +444,7 @@ begin
 { Remove ReponseFile }
 {$IFNDEF LinkTest}
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 {$ENDIF}
   MakeSharedLibrary:=success;   { otherwise a recursive call to link method }
 end;

+ 1 - 1
compiler/systems/t_watcom.pas

@@ -159,7 +159,7 @@ begin
 
 { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
-   RemoveFile(outputexedir+Info.ResName);
+   DeleteFile(outputexedir+Info.ResName);
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;

+ 8 - 8
compiler/systems/t_win.pas

@@ -1330,10 +1330,10 @@ implementation
       { Remove ReponseFile }
         if (success) and not(cs_link_nolink in current_settings.globalswitches) then
          begin
-           RemoveFile(outputexedir+Info.ResName);
-           RemoveFile('base.$$$');
-           RemoveFile('exp.$$$');
-           RemoveFile('deffile.$$$');
+           DeleteFile(outputexedir+Info.ResName);
+           DeleteFile('base.$$$');
+           DeleteFile('exp.$$$');
+           DeleteFile('deffile.$$$');
          end;
 
         MakeExecutable:=success;   { otherwise a recursive call to link method }
@@ -1432,10 +1432,10 @@ implementation
       { Remove ReponseFile }
         if (success) and not(cs_link_nolink in current_settings.globalswitches) then
          begin
-           RemoveFile(outputexedir+Info.ResName);
-           RemoveFile('base.$$$');
-           RemoveFile('exp.$$$');
-           RemoveFile('deffile.$$$');
+           DeleteFile(outputexedir+Info.ResName);
+           DeleteFile('base.$$$');
+           DeleteFile('exp.$$$');
+           DeleteFile('deffile.$$$');
          end;
         MakeSharedLibrary:=success;   { otherwise a recursive call to link method }
       end;