Browse Source

--- Merging r17670 into '.':
U utils/instantfpc/instantfptools.pas

# revisions: 17670
------------------------------------------------------------------------
r17670 | pierre | 2011-06-06 15:48:27 +0200 (Mon, 06 Jun 2011) | 1 line
Changed paths:
M /trunk/utils/instantfpc/instantfptools.pas

* Fix to allow go32v2 compliation
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@17673 -

marco 14 years ago
parent
commit
3c0fe9ddf4
1 changed files with 14 additions and 3 deletions
  1. 14 3
      utils/instantfpc/instantfptools.pas

+ 14 - 3
utils/instantfpc/instantfptools.pas

@@ -2,10 +2,21 @@ unit InstantFPTools;
 
 {$mode objfpc}{$H+}
 
+{$define UseFpExecV}
+
+{$ifdef MSWINDOWS}
+  {$undef UseFpExecV}
+  {$define HASEXEEXT}
+{$endif MSWINDOWS}
+{$ifdef go32v2}
+  {$undef UseFpExecV}
+  {$define HASEXEEXT}
+{$endif go32v2}
+
 interface
 
 uses
-  {$IFNDEF MSWINDOWS}
+  {$IFDEF UseFpExecV}
   Unix,
   {$ENDIF}
   Classes, SysUtils, Process;
@@ -200,7 +211,7 @@ begin
     if (p<>'') and (p[1]='-') then
       Result:=p; // copy compile params from the script
   end;
-  AddParam('-o'+OutputFilename {$IFDEF MSWINDOWS} + '.exe' {$ENDIF},Result);
+  AddParam('-o'+OutputFilename {$IFDEF HASEXEEXT} + '.exe' {$ENDIF},Result);
   AddParam(SrcFilename,Result);
 end;
 
@@ -216,7 +227,7 @@ begin
     end;
     inc(p);
   end;
-  {$IFDEF MSWINDOWS}
+  {$IFNDEF UseFpExecV}
     Inc(p); //lose the first command-line argument with the the script filename
     Halt(ExecuteProcess(Filename,[p^]));
   {$ELSE}