Amicommon: Fixed compilation after r33290

git-svn-id: trunk@33292 -
This commit is contained in:
marcus 2016-03-20 06:45:00 +00:00
parent 02dbec2085
commit b396d34364

View File

@ -34,6 +34,9 @@ interface
{$DEFINE HAS_SLEEP} {$DEFINE HAS_SLEEP}
{$DEFINE HAS_OSERROR} {$DEFINE HAS_OSERROR}
{OS has only 1 byte version for ExecuteProcess}
{$define executeprocuni}
{ used OS file system APIs use ansistring } { used OS file system APIs use ansistring }
{$define SYSUTILS_HAS_ANSISTR_FILEUTIL_IMPL} {$define SYSUTILS_HAS_ANSISTR_FILEUTIL_IMPL}
{ OS has an ansistring/single byte environment variable API } { OS has an ansistring/single byte environment variable API }
@ -115,7 +118,7 @@ function AmigaFileDateToDateTime(aDate: TDateStamp; out success: boolean): TDate
var var
tmpSecs: DWord; tmpSecs: DWord;
tmpDate: TDateTime; tmpDate: TDateTime;
tmpTime: TDateTime; tmpTime: TDateTime;
clockData: TClockData; clockData: TClockData;
begin begin
with aDate do with aDate do
@ -242,13 +245,13 @@ begin
dosResult:=-1; dosResult:=-1;
{ Open file in MODDE_READWRITE, then truncate it by hand rather than { Open file in MODDE_READWRITE, then truncate it by hand rather than
opening it in MODE_NEWFILE, because that returns an exclusive lock opening it in MODE_NEWFILE, because that returns an exclusive lock
so some operations might fail with it (KB) } so some operations might fail with it (KB) }
SystemFileName:=PathConv(ToSingleByteFileSystemEncodedFileName(FileName)); SystemFileName:=PathConv(ToSingleByteFileSystemEncodedFileName(FileName));
dosResult:=Open(PChar(SystemFileName),MODE_READWRITE); dosResult:=Open(PChar(SystemFileName),MODE_READWRITE);
if dosResult = 0 then exit; if dosResult = 0 then exit;
if SetFileSize(dosResult, 0, OFFSET_BEGINNING) = 0 then if SetFileSize(dosResult, 0, OFFSET_BEGINNING) = 0 then
AddToList(ASYS_fileList,dosResult) AddToList(ASYS_fileList,dosResult)
else begin else begin
dosClose(dosResult); dosClose(dosResult);
@ -303,7 +306,7 @@ begin
end; end;
dosSeek(Handle, FOffset, seekMode); dosSeek(Handle, FOffset, seekMode);
{ get the current position when FileSeek ends, which should return { get the current position when FileSeek ends, which should return
the *NEW* position, while Amiga Seek() returns the old one } the *NEW* position, while Amiga Seek() returns the old one }
FileSeek:=dosSeek(Handle, 0, OFFSET_CURRENT); FileSeek:=dosSeek(Handle, 0, OFFSET_CURRENT);
end; end;
@ -329,7 +332,7 @@ var
dosResult: LongInt; dosResult: LongInt;
begin begin
FileTruncate:=False; FileTruncate:=False;
if Size > high (longint) then exit; if Size > high (longint) then exit;
{$WARNING Possible support for 64-bit FS to be checked!} {$WARNING Possible support for 64-bit FS to be checked!}
@ -540,10 +543,10 @@ end;
var var
DeviceList: array[0..26] of string[20]; DeviceList: array[0..26] of string[20];
NumDevices: Integer = 0; NumDevices: Integer = 0;
const const
IllegalDevices: array[0..12] of string =( IllegalDevices: array[0..12] of string =(
'PED:', 'PED:',
'PRJ:', 'PRJ:',
'PIPE:', // Pipes 'PIPE:', // Pipes
'XPIPE:', // Extented Pipe 'XPIPE:', // Extented Pipe
@ -754,7 +757,7 @@ end;
Procedure InitInternational; Procedure InitInternational;
begin begin
InitInternationalGeneric; InitInternationalGeneric;
InitAnsi; InitAnsi;
end; end;
@ -791,7 +794,7 @@ begin
{ Alternatively, this could use PIPE: handler on systems which { Alternatively, this could use PIPE: handler on systems which
have this by default (not the case on classic Amiga), but then have this by default (not the case on classic Amiga), but then
the child process should be started async, which for a simple the child process should be started async, which for a simple
Path command probably isn't worth the trouble. (KB) } Path command probably isn't worth the trouble. (KB) }
assign(f,'T:'+HexStr(FindTask(nil))+'_path.tmp'); assign(f,'T:'+HexStr(FindTask(nil))+'_path.tmp');
rewrite(f); rewrite(f);
@ -848,10 +851,10 @@ var
E: EOSError; E: EOSError;
begin begin
DosError:= 0; DosError:= 0;
convPath:=PathConv((ToSingleByteFileSystemEncodedFileName(Path)); convPath:=PathConv(ToSingleByteFileSystemEncodedFileName(Path));
tmpPath:=convPath+' '+ToSingleByteFileSystemEncodedFileName(ComLine); tmpPath:=convPath+' '+ToSingleByteFileSystemEncodedFileName(ComLine);
{ Here we must first check if the command we wish to execute } { Here we must first check if the command we wish to execute }
{ actually exists, because this is NOT handled by the } { actually exists, because this is NOT handled by the }
{ _SystemTagList call (program will abort!!) } { _SystemTagList call (program will abort!!) }
@ -870,13 +873,13 @@ begin
end end
else else
DosError:=3; DosError:=3;
if DosError <> 0 then begin if DosError <> 0 then begin
if ComLine = '' then if ComLine = '' then
CommandLine := Path CommandLine := Path
else else
CommandLine := Path + ' ' + ComLine; CommandLine := Path + ' ' + ComLine;
E := EOSError.CreateFmt (SExecuteProcessFailed, [CommandLine, DosError]); E := EOSError.CreateFmt (SExecuteProcessFailed, [CommandLine, DosError]);
E.ErrorCode := DosError; E.ErrorCode := DosError;
raise E; raise E;
@ -913,10 +916,10 @@ end;
Initialization Initialization
InitExceptions; InitExceptions;
InitInternational; { Initialize internationalization settings } InitInternational; { Initialize internationalization settings }
OnBeep:=Nil; { No SysBeep() on Amiga, for now. Figure out if we want OnBeep:=Nil; { No SysBeep() on Amiga, for now. Figure out if we want
to use intuition.library/DisplayBeep() for this (KB) } to use intuition.library/DisplayBeep() for this (KB) }
StrOfPaths:=''; StrOfPaths:='';
RefreshDeviceList; RefreshDeviceList;
Finalization Finalization
DoneExceptions; DoneExceptions;