mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 16:39:19 +02:00
+ Merged revision 321
git-svn-id: branches/fixes_2_0@322 -
This commit is contained in:
parent
23f1eb66d2
commit
67d69581e5
@ -19,9 +19,7 @@ Const
|
|||||||
RLIM_NLIMITS = RLIMIT_NLIMITS;
|
RLIM_NLIMITS = RLIMIT_NLIMITS;
|
||||||
|
|
||||||
RLIM_INFINITY = LongInt(-1);
|
RLIM_INFINITY = LongInt(-1);
|
||||||
{$ifndef ver1_0}
|
|
||||||
RLIM64_INFINITY = Int64(-1);
|
RLIM64_INFINITY = Int64(-1);
|
||||||
{$endif}
|
|
||||||
|
|
||||||
RLIM_SAVED_MAX = RLIM_INFINITY;
|
RLIM_SAVED_MAX = RLIM_INFINITY;
|
||||||
RLIM_SAVED_CUR = RLIM_INFINITY;
|
RLIM_SAVED_CUR = RLIM_INFINITY;
|
||||||
|
@ -11,11 +11,7 @@ Type
|
|||||||
P__long_double_t = ^__long_double_t;
|
P__long_double_t = ^__long_double_t;
|
||||||
size_t = Cardinal;
|
size_t = Cardinal;
|
||||||
Psize_t = size_t;
|
Psize_t = size_t;
|
||||||
{$ifdef ver1_0}
|
|
||||||
UInt64 = Int64; // Must be unsigned.
|
|
||||||
{$else}
|
|
||||||
UInt64 = 0..High(Int64); // Must be unsigned.
|
UInt64 = 0..High(Int64); // Must be unsigned.
|
||||||
{$endif}
|
|
||||||
wchar_t = widechar;
|
wchar_t = widechar;
|
||||||
Pwchar_t = ^wchar_t;
|
Pwchar_t = ^wchar_t;
|
||||||
PPwchar_t = ^Pwchar_t;
|
PPwchar_t = ^Pwchar_t;
|
||||||
|
@ -18,8 +18,6 @@ const
|
|||||||
|
|
||||||
LONG_MIN = (-(LONG_MAX)) - 1;
|
LONG_MIN = (-(LONG_MAX)) - 1;
|
||||||
ULONG_MAX = 4294967295;
|
ULONG_MAX = 4294967295;
|
||||||
{$ifndef ver1_0}
|
|
||||||
LLONG_MAX = QWord(9223372036854775807);
|
LLONG_MAX = QWord(9223372036854775807);
|
||||||
LLONG_MIN = (-LLONG_MAX - 1);
|
LLONG_MIN = (-LLONG_MAX - 1);
|
||||||
ULLONG_MAX = 18446744073709551615;
|
ULLONG_MAX = 18446744073709551615;
|
||||||
{$endif}
|
|
||||||
|
@ -34,75 +34,55 @@ const
|
|||||||
INT8_MIN = -(128);
|
INT8_MIN = -(128);
|
||||||
INT16_MIN = (-(32767)) - 1;
|
INT16_MIN = (-(32767)) - 1;
|
||||||
INT32_MIN = (-(2147483647)) - 1;
|
INT32_MIN = (-(2147483647)) - 1;
|
||||||
{$ifndef ver1_0}
|
|
||||||
INT64_MIN = int64_t(-int64_t(9223372036854775807)-1);
|
INT64_MIN = int64_t(-int64_t(9223372036854775807)-1);
|
||||||
{$endif}
|
|
||||||
|
|
||||||
INT8_MAX = 127;
|
INT8_MAX = 127;
|
||||||
INT16_MAX = 32767;
|
INT16_MAX = 32767;
|
||||||
INT32_MAX = 2147483647;
|
INT32_MAX = 2147483647;
|
||||||
{$ifndef ver1_0}
|
|
||||||
INT64_MAX = int64_t(9223372036854775807);
|
INT64_MAX = int64_t(9223372036854775807);
|
||||||
{$endif}
|
|
||||||
|
|
||||||
UINT8_MAX = 255;
|
UINT8_MAX = 255;
|
||||||
UINT16_MAX = 65535;
|
UINT16_MAX = 65535;
|
||||||
UINT32_MAX = 4294967295;
|
UINT32_MAX = 4294967295;
|
||||||
{$ifndef ver1_0}
|
|
||||||
UINT64_MAX = uint64_t(-1);
|
UINT64_MAX = uint64_t(-1);
|
||||||
{$endif}
|
|
||||||
|
|
||||||
INT_LEAST8_MIN = -(128);
|
INT_LEAST8_MIN = -(128);
|
||||||
INT_LEAST16_MIN = (-(32767)) - 1;
|
INT_LEAST16_MIN = (-(32767)) - 1;
|
||||||
INT_LEAST32_MIN = (-(2147483647)) - 1;
|
INT_LEAST32_MIN = (-(2147483647)) - 1;
|
||||||
{$ifndef ver1_0}
|
|
||||||
INT_LEAST64_MIN = int_least64_t(-int64_t(9223372036854775807)-1);
|
INT_LEAST64_MIN = int_least64_t(-int64_t(9223372036854775807)-1);
|
||||||
{$endif}
|
|
||||||
|
|
||||||
INT_LEAST8_MAX = 127;
|
INT_LEAST8_MAX = 127;
|
||||||
INT_LEAST16_MAX = 32767;
|
INT_LEAST16_MAX = 32767;
|
||||||
INT_LEAST32_MAX = 2147483647;
|
INT_LEAST32_MAX = 2147483647;
|
||||||
{$ifndef ver1_0}
|
|
||||||
INT_LEAST64_MAX = int_least64_t(9223372036854775807);
|
INT_LEAST64_MAX = int_least64_t(9223372036854775807);
|
||||||
{$endif}
|
|
||||||
|
|
||||||
UINT_LEAST8_MAX = 255;
|
UINT_LEAST8_MAX = 255;
|
||||||
UINT_LEAST16_MAX = 65535;
|
UINT_LEAST16_MAX = 65535;
|
||||||
UINT_LEAST32_MAX = 4294967295;
|
UINT_LEAST32_MAX = 4294967295;
|
||||||
{$ifndef ver1_0}
|
|
||||||
UINT_LEAST64_MAX = uint_least64_t(-1);
|
UINT_LEAST64_MAX = uint_least64_t(-1);
|
||||||
{$endif}
|
|
||||||
|
|
||||||
INT_FAST8_MIN = -(128);
|
INT_FAST8_MIN = -(128);
|
||||||
INT_FAST16_MIN = (-(2147483647)) - 1;
|
INT_FAST16_MIN = (-(2147483647)) - 1;
|
||||||
INT_FAST32_MIN = (-(2147483647)) - 1;
|
INT_FAST32_MIN = (-(2147483647)) - 1;
|
||||||
{$ifndef ver1_0}
|
|
||||||
INT_FAST64_MIN = int_fast64_t(-Int64(9223372036854775807)-1);
|
INT_FAST64_MIN = int_fast64_t(-Int64(9223372036854775807)-1);
|
||||||
{$endif}
|
|
||||||
|
|
||||||
INT_FAST8_MAX = 127;
|
INT_FAST8_MAX = 127;
|
||||||
INT_FAST16_MAX = 2147483647;
|
INT_FAST16_MAX = 2147483647;
|
||||||
INT_FAST32_MAX = 2147483647;
|
INT_FAST32_MAX = 2147483647;
|
||||||
{$ifndef ver1_0}
|
|
||||||
INT_FAST64_MAX = int_fast64_t(9223372036854775807);
|
INT_FAST64_MAX = int_fast64_t(9223372036854775807);
|
||||||
{$endif}
|
|
||||||
|
|
||||||
UINT_FAST8_MAX = 255;
|
UINT_FAST8_MAX = 255;
|
||||||
UINT_FAST16_MAX = 4294967295;
|
UINT_FAST16_MAX = 4294967295;
|
||||||
UINT_FAST32_MAX = 4294967295;
|
UINT_FAST32_MAX = 4294967295;
|
||||||
{$ifndef ver1_0}
|
|
||||||
UINT_FAST64_MAX = uint_fast64_t(-1);
|
UINT_FAST64_MAX = uint_fast64_t(-1);
|
||||||
{$endif}
|
|
||||||
|
|
||||||
INTPTR_MIN = (-(2147483647)) - 1;
|
INTPTR_MIN = (-(2147483647)) - 1;
|
||||||
INTPTR_MAX = 2147483647;
|
INTPTR_MAX = 2147483647;
|
||||||
UINTPTR_MAX = 4294967295;
|
UINTPTR_MAX = 4294967295;
|
||||||
|
|
||||||
{$ifndef ver1_0}
|
|
||||||
INTMAX_MIN = Int64(-Int64(9223372036854775807)-1);
|
INTMAX_MIN = Int64(-Int64(9223372036854775807)-1);
|
||||||
INTMAX_MAX = Int64(9223372036854775807);
|
INTMAX_MAX = Int64(9223372036854775807);
|
||||||
UINTMAX_MAX = QWord(-1);
|
UINTMAX_MAX = QWord(-1);
|
||||||
{$endif}
|
|
||||||
|
|
||||||
PTRDIFF_MIN = (-(2147483647)) - 1;
|
PTRDIFF_MIN = (-(2147483647)) - 1;
|
||||||
PTRDIFF_MAX = 2147483647;
|
PTRDIFF_MAX = 2147483647;
|
||||||
|
@ -70,11 +70,6 @@ CONST ULONG_MAX= high(culong);
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{$ifdef ver1_0}
|
|
||||||
cint = longint;
|
|
||||||
pcint = ^cint;
|
|
||||||
size_t = cardinal;
|
|
||||||
{$endif}
|
|
||||||
psize_t = ^size_t;
|
psize_t = ^size_t;
|
||||||
psigset_t = ^sigset;
|
psigset_t = ^sigset;
|
||||||
|
|
||||||
|
@ -22,9 +22,7 @@ interface
|
|||||||
|
|
||||||
{$ifdef BSD}
|
{$ifdef BSD}
|
||||||
|
|
||||||
{$ifndef ver1_0}
|
|
||||||
Uses BaseUnix, unixtype;
|
Uses BaseUnix, unixtype;
|
||||||
{$endif}
|
|
||||||
|
|
||||||
{$i pthrbsd.inc}
|
{$i pthrbsd.inc}
|
||||||
|
|
||||||
|
@ -75,17 +75,10 @@ here. *)
|
|||||||
|
|
||||||
{UT: these settings create matching records: }
|
{UT: these settings create matching records: }
|
||||||
{$packrecords 4}
|
{$packrecords 4}
|
||||||
{$ifndef ver1_0}
|
|
||||||
{$ALIGN 4}
|
{$ALIGN 4}
|
||||||
{$endif}
|
|
||||||
{$MINENUMSIZE 4}
|
{$MINENUMSIZE 4}
|
||||||
|
|
||||||
|
|
||||||
{$ifdef ver1_0}
|
|
||||||
Type
|
|
||||||
PBoolean = ^Boolean;
|
|
||||||
PLongWord = ^LongWord;
|
|
||||||
{$endif}
|
|
||||||
|
|
||||||
const
|
const
|
||||||
BFD_VERSION = '2.10.91';
|
BFD_VERSION = '2.10.91';
|
||||||
@ -149,7 +142,7 @@ type
|
|||||||
is in practice already 0 *)
|
is in practice already 0 *)
|
||||||
|
|
||||||
bfd_format = (
|
bfd_format = (
|
||||||
bfd_unknown {$ifndef ver1_0}= 0{$endif}, (* file format is unknown *)
|
bfd_unknown = 0, (* file format is unknown *)
|
||||||
bfd_object, (* linker/assember/compiler output *)
|
bfd_object, (* linker/assember/compiler output *)
|
||||||
bfd_archive, (* object archive file *)
|
bfd_archive, (* object archive file *)
|
||||||
bfd_core (* core dump *)
|
bfd_core (* core dump *)
|
||||||
@ -270,10 +263,10 @@ is in practice already 0 *)
|
|||||||
name: pchar;
|
name: pchar;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
bfd_direction = (no_direction {$ifndef ver1_0}= 0{$endif},
|
bfd_direction = (no_direction = 0,
|
||||||
read_direction {$ifndef ver1_0}= 1{$endif},
|
read_direction = 1,
|
||||||
write_direction {$ifndef ver1_0}= 2{$endif},
|
write_direction = 2,
|
||||||
both_direction {$ifndef ver1_0}= 3{$endif});
|
both_direction = 3);
|
||||||
|
|
||||||
TBFD = record
|
TBFD = record
|
||||||
(* The filename the application opened the BFD with. *)
|
(* The filename the application opened the BFD with. *)
|
||||||
@ -1913,7 +1906,7 @@ is in practice already 0 *)
|
|||||||
arelent_chain = relent_chain;
|
arelent_chain = relent_chain;
|
||||||
|
|
||||||
bfd_error = (
|
bfd_error = (
|
||||||
bfd_error_no_error {$ifndef Ver1_0} = 0 {$endif},
|
bfd_error_no_error = 0 ,
|
||||||
bfd_error_system_call,
|
bfd_error_system_call,
|
||||||
bfd_error_invalid_target,
|
bfd_error_invalid_target,
|
||||||
bfd_error_wrong_format,
|
bfd_error_wrong_format,
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
uses
|
uses
|
||||||
{$ifdef ver1_0}
|
|
||||||
linux,
|
|
||||||
{$else}
|
|
||||||
baseunix,
|
baseunix,
|
||||||
unix,
|
unix,
|
||||||
{$endif}
|
|
||||||
lincd;
|
lincd;
|
||||||
|
|
||||||
Function ReadCDTOC(Device : String; Var CDTOC : Array of TTocEntry) : Integer;
|
Function ReadCDTOC(Device : String; Var CDTOC : Array of TTocEntry) : Integer;
|
||||||
@ -15,17 +11,13 @@ Var
|
|||||||
tocentry : tcdrom_tocentry;
|
tocentry : tcdrom_tocentry;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
drive:={$ifdef ver1_0}fdopen{$else}fpOpen{$endif}(Device, Open_RDONLY or Open_NONBLOCK);
|
drive:=fpOpen(Device, Open_RDONLY or Open_NONBLOCK);
|
||||||
if drive<0 then
|
if drive<0 then
|
||||||
begin
|
begin
|
||||||
Result:=-1;
|
Result:=-1;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
{$Ifdef ver1_0}
|
|
||||||
if not ioctl(drive, CDROMREADTOCHDR, @tochdr) then
|
|
||||||
{$else}
|
|
||||||
if fpioctl(drive, CDROMREADTOCHDR, @tochdr)<>0 then
|
if fpioctl(drive, CDROMREADTOCHDR, @tochdr)<>0 then
|
||||||
{$endif}
|
|
||||||
begin
|
begin
|
||||||
Result:=-1;
|
Result:=-1;
|
||||||
Exit;
|
Exit;
|
||||||
@ -39,7 +31,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
tocentry.cdte_track := i;
|
tocentry.cdte_track := i;
|
||||||
tocentry.cdte_format := CDROM_MSF;
|
tocentry.cdte_format := CDROM_MSF;
|
||||||
{$ifdef ver1_0}ioctl{$else}fpIOCtl{$endif}(drive, CDROMREADTOCENTRY, @tocentry);
|
fpIOCtl(drive, CDROMREADTOCENTRY, @tocentry);
|
||||||
// We should do some error checking here actually.
|
// We should do some error checking here actually.
|
||||||
With cdtoc[result] do
|
With cdtoc[result] do
|
||||||
begin
|
begin
|
||||||
@ -53,7 +45,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
tocentry.cdte_track := $AA;
|
tocentry.cdte_track := $AA;
|
||||||
tocentry.cdte_format := CDROM_MSF;
|
tocentry.cdte_format := CDROM_MSF;
|
||||||
{$ifdef ver1_0}ioctl{$else}fpIOCtl{$endif}(drive, CDROMREADTOCENTRY, @tocentry);
|
fpIOCtl(drive, CDROMREADTOCENTRY, @tocentry);
|
||||||
With cdtoc[Result] do
|
With cdtoc[Result] do
|
||||||
begin
|
begin
|
||||||
Min := tocentry.cdte_addr.msf.minute;
|
Min := tocentry.cdte_addr.msf.minute;
|
||||||
@ -63,7 +55,7 @@ begin
|
|||||||
inc(frame, sec*75);
|
inc(frame, sec*75);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$ifdef ver1_0}fdclose{$else}fpClose{$endif}(drive);
|
fpClose(drive);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ ---------------------------------------------------------------------
|
{ ---------------------------------------------------------------------
|
||||||
|
@ -18,13 +18,8 @@ unit lincd;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
{$ifdef ver1_0}
|
|
||||||
linux
|
|
||||||
{$else}
|
|
||||||
baseunix,
|
baseunix,
|
||||||
unix
|
unix;
|
||||||
{$endif}
|
|
||||||
;
|
|
||||||
|
|
||||||
{ ---------------------------------------------------------------------
|
{ ---------------------------------------------------------------------
|
||||||
cdrom.h header translation.
|
cdrom.h header translation.
|
||||||
@ -47,7 +42,7 @@ Type
|
|||||||
{$PACKRECORDS C}
|
{$PACKRECORDS C}
|
||||||
|
|
||||||
const
|
const
|
||||||
EDRIVE_CANT_DO_THIS = {$ifdef ver1_0}Sys_EOPNOTSUPP{$else}ESysEOPNOTSUPP{$endif}; // = 95
|
EDRIVE_CANT_DO_THIS = ESysEOPNOTSUPP; // = 95
|
||||||
CDROMPAUSE = $5301;
|
CDROMPAUSE = $5301;
|
||||||
CDROMRESUME = $5302;
|
CDROMRESUME = $5302;
|
||||||
CDROMPLAYMSF = $5303;
|
CDROMPLAYMSF = $5303;
|
||||||
@ -1155,23 +1150,15 @@ begin
|
|||||||
Writeln('Testing device : ',Device);
|
Writeln('Testing device : ',Device);
|
||||||
{$endif}
|
{$endif}
|
||||||
Result:=False;
|
Result:=False;
|
||||||
{$ifdef ver1_0}
|
|
||||||
If not fstat(device,info) then
|
|
||||||
{$else}
|
|
||||||
If fpstat(device,info)<>0 then
|
If fpstat(device,info)<>0 then
|
||||||
{$endif}
|
|
||||||
exit;
|
exit;
|
||||||
if not ({$ifdef ver1_0}S_ISCHR{$else}fpS_ISCHR{$endif}(info.mode) or
|
if not (fpS_ISCHR(info.mode) or
|
||||||
{$Ifdef ver1_0}S_ISBLK{$else}fpS_ISBLK{$endif}(info.mode)) then
|
fpS_ISBLK(info.mode)) then
|
||||||
exit;
|
exit;
|
||||||
S:={$ifdef ver1_0}ReadLink{$else}fpReadLink{$endif}(Device);
|
S:=fpReadLink(Device);
|
||||||
If (S<>'') then
|
If (S<>'') then
|
||||||
Device:=S;
|
Device:=S;
|
||||||
{$ifdef ver1_0}
|
|
||||||
If Not FStat(Device,info) then
|
|
||||||
{$else}
|
|
||||||
If fpStat(Device,info)<>0 then
|
If fpStat(Device,info)<>0 then
|
||||||
{$endif}
|
|
||||||
exit;
|
exit;
|
||||||
DeviceMajor:=info.rdev shr 8;
|
DeviceMajor:=info.rdev shr 8;
|
||||||
If DeviceMajor in [IDE0_MAJOR,IDE1_MAJOR,IDE2_MAJOR,IDE3_MAJOR] then
|
If DeviceMajor in [IDE0_MAJOR,IDE1_MAJOR,IDE2_MAJOR,IDE3_MAJOR] then
|
||||||
@ -1185,10 +1172,10 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
F:={$ifdef ver1_0}fdOpen{$else}fpOpen{$endif}(Device,OPEN_RDONLY or OPEN_NONBLOCK);
|
F:=fpOpen(Device,OPEN_RDONLY or OPEN_NONBLOCK);
|
||||||
Result:=(F>=0);
|
Result:=(F>=0);
|
||||||
If Result then
|
If Result then
|
||||||
{$ifdef ver1_0}fdClose{$else}fpClose{$endif}(F);
|
fpClose(F);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1204,15 +1191,11 @@ begin
|
|||||||
Writeln('Testing for ATAPI');
|
Writeln('Testing for ATAPI');
|
||||||
{$endif}
|
{$endif}
|
||||||
Result:=False;
|
Result:=False;
|
||||||
f:={$ifdef ver1_0}fdOpen{$else}fpOpen{$endif}(device,OPEN_RDONLY or OPEN_NONBLOCK);
|
f:=fpOpen(device,OPEN_RDONLY or OPEN_NONBLOCK);
|
||||||
If (f<0) then
|
If (f<0) then
|
||||||
exit;
|
exit;
|
||||||
{$ifdef ver1_0}
|
|
||||||
Result:=ioctl(f,CDROMVOLREAD,@info);
|
|
||||||
{$else}
|
|
||||||
Result:=(fpIOCtl(f,CDROMVOLREAD,@info)=0);
|
Result:=(fpIOCtl(f,CDROMVOLREAD,@info)=0);
|
||||||
{$endif}
|
fpClose(f);
|
||||||
{$ifdef ver1_0}fdClose{$else}fpClose{$endif}(f);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -21,14 +21,9 @@ Program fd2pascal;
|
|||||||
|
|
||||||
|
|
||||||
uses
|
uses
|
||||||
{$ifdef ver1_0}
|
|
||||||
Linux
|
|
||||||
{$else}
|
|
||||||
baseunix,
|
baseunix,
|
||||||
Unix,
|
Unix,
|
||||||
unixutil
|
unixutil;
|
||||||
{$endif}
|
|
||||||
;
|
|
||||||
|
|
||||||
Const RevString = '$Revision: 1.5 $';
|
Const RevString = '$Revision: 1.5 $';
|
||||||
NrOptions = 4;
|
NrOptions = 4;
|
||||||
@ -506,22 +501,12 @@ var info : stat;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
FileName:=Copy(Filename,1,Length(Filename)-3)+'.pp';
|
FileName:=Copy(Filename,1,Length(Filename)-3)+'.pp';
|
||||||
{$ifdef ver1_0}
|
|
||||||
fstat(FileName,info);
|
|
||||||
if linuxerror=0 then
|
|
||||||
begin
|
|
||||||
{ File exists, move to .bak}
|
|
||||||
link(FileName,FileName+'.bak');
|
|
||||||
unlink(FileName);
|
|
||||||
end;
|
|
||||||
{$else}
|
|
||||||
if fpstat(FileName,info)<>-1 Then
|
if fpstat(FileName,info)<>-1 Then
|
||||||
begin
|
begin
|
||||||
{ File exists, move to .bak}
|
{ File exists, move to .bak}
|
||||||
fplink (FileName,FileName+'.bak');
|
fplink (FileName,FileName+'.bak');
|
||||||
fpunlink(FileName);
|
fpunlink(FileName);
|
||||||
end;
|
end;
|
||||||
{$endif}
|
|
||||||
|
|
||||||
assign(outfile,filename);
|
assign(outfile,filename);
|
||||||
{$i-}
|
{$i-}
|
||||||
|
@ -795,7 +795,7 @@ End;
|
|||||||
{ Wait for DTime milliseconds }
|
{ Wait for DTime milliseconds }
|
||||||
Procedure Delay(DTime: Word);
|
Procedure Delay(DTime: Word);
|
||||||
Begin
|
Begin
|
||||||
{$ifdef ver1_0}Select{$else}fpselect{$endif}(0,nil,nil,nil,DTime);
|
fpselect(0,nil,nil,nil,DTime);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
{ create a new subwindow of stdscr }
|
{ create a new subwindow of stdscr }
|
||||||
|
@ -26,12 +26,8 @@ Interface
|
|||||||
|
|
||||||
Uses
|
Uses
|
||||||
{$ifdef Unix}
|
{$ifdef Unix}
|
||||||
{$ifdef ver1_0}
|
|
||||||
linux,
|
|
||||||
{$else}
|
|
||||||
baseunix,
|
baseunix,
|
||||||
termio,
|
termio,
|
||||||
{$endif}
|
|
||||||
{$endif}
|
{$endif}
|
||||||
ncurses,
|
ncurses,
|
||||||
dos; {dos needed for TextRec}
|
dos; {dos needed for TextRec}
|
||||||
|
@ -150,12 +150,8 @@ Interface
|
|||||||
|
|
||||||
Uses
|
Uses
|
||||||
{$ifdef unix}
|
{$ifdef unix}
|
||||||
{$ifdef ver1_0}
|
|
||||||
linux,
|
|
||||||
{$else}
|
|
||||||
baseunix,
|
baseunix,
|
||||||
termio,
|
termio,
|
||||||
{$endif}
|
|
||||||
{$endif}
|
{$endif}
|
||||||
ncurses,panel,menu,
|
ncurses,panel,menu,
|
||||||
dos; {dos needed for TextRec}
|
dos; {dos needed for TextRec}
|
||||||
@ -1256,20 +1252,16 @@ End;
|
|||||||
----------------------------------------------}
|
----------------------------------------------}
|
||||||
function nKeypressed(timeout : word) : boolean;
|
function nKeypressed(timeout : word) : boolean;
|
||||||
var
|
var
|
||||||
fds : {$ifdef ver1_0}FDSet{$else}TFDSet{$endif};
|
fds : TFDSet;
|
||||||
maxFD : longint;
|
maxFD : longint;
|
||||||
Begin
|
Begin
|
||||||
{$ifdef ver1_0}FD_Zero{$else}fpFD_Zero{$endif}(fds);
|
fpFD_Zero(fds);
|
||||||
maxFD := 1;
|
maxFD := 1;
|
||||||
{ turn on stdin bit }
|
{ turn on stdin bit }
|
||||||
{$ifdef ver1_0}
|
|
||||||
If not FD_IsSet(STDIN,fds) Then
|
|
||||||
{$else}
|
|
||||||
If fpFD_IsSet(STDIN,fds)=0 Then
|
If fpFD_IsSet(STDIN,fds)=0 Then
|
||||||
{$endif}
|
fpFD_Set(STDIN,fds);
|
||||||
{$ifdef ver1_0}FD_Set{$else}fpFD_Set{$endif}(STDIN,fds);
|
|
||||||
{ wait for some input }
|
{ wait for some input }
|
||||||
If {$ifdef ver1_0}Select{$else}fpSelect{$endif}(maxFD,@fds,nil,nil,timeout) > 0 Then
|
If fpSelect(maxFD,@fds,nil,nil,timeout) > 0 Then
|
||||||
nKeypressed := TRUE
|
nKeypressed := TRUE
|
||||||
Else
|
Else
|
||||||
nKeypressed := FALSE;
|
nKeypressed := FALSE;
|
||||||
|
@ -3,13 +3,8 @@ unit Utmp;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
{$ifdef ver1_0}
|
|
||||||
Linux
|
|
||||||
{$else}
|
|
||||||
BaseUnix,
|
BaseUnix,
|
||||||
Unix
|
Unix;
|
||||||
{$endif}
|
|
||||||
;
|
|
||||||
|
|
||||||
const
|
const
|
||||||
Device_name_length = 12;
|
Device_name_length = 12;
|
||||||
@ -247,8 +242,8 @@ var
|
|||||||
S : Stat;
|
S : Stat;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{$ifdef ver1_0}FStat{$else}fpstat{$endif}(Utmp_file, S);
|
fpstat(Utmp_file, S);
|
||||||
Number_of_utmp_entries := {$ifdef ver1_0}S.Size{$else}s.st_size{$endif} div System.SizeOf(tLL_Utmp);
|
Number_of_utmp_entries := s.st_size div System.SizeOf(tLL_Utmp);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ Uses Windows,types;
|
|||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
{$ifndef ver1_0}
|
|
||||||
{ extra types }
|
{ extra types }
|
||||||
TOleChar = Types.TOleChar;
|
TOleChar = Types.TOleChar;
|
||||||
POleStr = Types.POleStr;
|
POleStr = Types.POleStr;
|
||||||
@ -35,9 +34,6 @@ type
|
|||||||
TBStr = POleStr;
|
TBStr = POleStr;
|
||||||
PBStr = ^TBStr;
|
PBStr = ^TBStr;
|
||||||
TOleEnum = type LongWord;
|
TOleEnum = type LongWord;
|
||||||
{$else ver1_0}
|
|
||||||
POleStr = PWideChar;
|
|
||||||
{$endif ver1_0}
|
|
||||||
|
|
||||||
{Glue types, should be linked to the proper windows unit types}
|
{Glue types, should be linked to the proper windows unit types}
|
||||||
TYPE
|
TYPE
|
||||||
|
Loading…
Reference in New Issue
Block a user