mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 16:40:25 +02:00
Fix for Mantis #30279. Apply patch by Max Nazhalov to fix compilation of i386-wince and arm-wince (the only modification is that the no longer used AnsiString variants of ExecuteProcess are removed)
git-svn-id: trunk@33996 -
This commit is contained in:
parent
1cbae41cab
commit
dfe00a8ed1
@ -619,7 +619,12 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString;Flags:TExecuteFlags=[]):integer;
|
||||
function ExecuteProcess(Const Path: RawByteString; Const ComLine: RawByteString;Flags:TExecuteFlags=[]):integer;
|
||||
begin
|
||||
result:=ExecuteProcess(UnicodeString(Path),UnicodeString(ComLine),Flags);
|
||||
end;
|
||||
|
||||
function ExecuteProcess(Const Path: UnicodeString; Const ComLine: UnicodeString;Flags:TExecuteFlags=[]):integer;
|
||||
var
|
||||
PI: TProcessInformation;
|
||||
Proc : THandle;
|
||||
@ -628,7 +633,7 @@ var
|
||||
|
||||
begin
|
||||
DosError := 0;
|
||||
if not CreateProcess(PWideChar(widestring(Path)), PWideChar(widestring(ComLine)),
|
||||
if not CreateProcess(PWideChar(Path), PWideChar(ComLine),
|
||||
nil, nil, FALSE, 0, nil, nil, nil, PI) then
|
||||
begin
|
||||
e:=EOSError.CreateFmt(SExecuteProcessFailed,[Path,GetLastError]);
|
||||
@ -652,22 +657,37 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function ExecuteProcess(Const Path: AnsiString; Const ComLine: Array of AnsiString;Flags:TExecuteFlags=[]):integer;
|
||||
|
||||
function ExecuteProcess(Const Path: UnicodeString; Const ComLine: Array of UnicodeString;Flags:TExecuteFlags=[]):integer;
|
||||
|
||||
var
|
||||
CommandLine: AnsiString;
|
||||
CommandLine: UnicodeString;
|
||||
I: integer;
|
||||
|
||||
begin
|
||||
Commandline := '';
|
||||
for I := 0 to High (ComLine) do
|
||||
if Pos (' ', ComLine [I]) <> 0 then
|
||||
CommandLine := CommandLine + ' ' + '"' + ComLine [I] + '"'
|
||||
else
|
||||
CommandLine := CommandLine + ' ' + Comline [I];
|
||||
if Pos (' ', ComLine [I]) <> 0 then
|
||||
CommandLine := CommandLine + ' ' + '"' + ComLine [I] + '"'
|
||||
else
|
||||
CommandLine := CommandLine + ' ' + Comline [I];
|
||||
ExecuteProcess := ExecuteProcess (Path, CommandLine);
|
||||
end;
|
||||
|
||||
function ExecuteProcess(Const Path: RawByteString; Const ComLine: Array of RawByteString;Flags:TExecuteFlags=[]):integer;
|
||||
|
||||
var
|
||||
CommandLine: UnicodeString;
|
||||
I: integer;
|
||||
|
||||
begin
|
||||
Commandline := '';
|
||||
for I := 0 to High (ComLine) do
|
||||
if Pos (' ', ComLine [I]) <> 0 then
|
||||
CommandLine := CommandLine + ' ' + '"' + ComLine [I] + '"'
|
||||
else
|
||||
CommandLine := CommandLine + ' ' + Comline [I];
|
||||
ExecuteProcess := ExecuteProcess (UnicodeString(Path), CommandLine,Flags);
|
||||
end;
|
||||
|
||||
Procedure Sleep(Milliseconds : Cardinal);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user