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