mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-03 05:07:29 +01:00
* fixed 2.0.x compilation
git-svn-id: trunk@1241 -
This commit is contained in:
parent
22e17d51db
commit
230bd19451
@ -18,7 +18,7 @@
|
|||||||
IOCtl and Termios calls
|
IOCtl and Termios calls
|
||||||
******************************************************************************}
|
******************************************************************************}
|
||||||
|
|
||||||
Function TCGetAttr(fd:cint;var tios:TermIOS):cint;
|
Function TCGetAttr(fd:cint;var tios:TermIOS):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCGETAttr:=fpIoCtl(Fd,TIOCGETA,@tios);
|
TCGETAttr:=fpIoCtl(Fd,TIOCGETA,@tios);
|
||||||
end;
|
end;
|
||||||
@ -41,13 +41,13 @@ begin
|
|||||||
TCSetAttr:=fpIOCtl(fd,nr,@Tios);
|
TCSetAttr:=fpIOCtl(fd,nr,@Tios);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal);
|
Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
tios.c_ispeed:=speed; {Probably the Bxxxx speed constants}
|
tios.c_ispeed:=speed; {Probably the Bxxxx speed constants}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal);
|
Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
tios.c_ospeed:=speed;
|
tios.c_ospeed:=speed;
|
||||||
end;
|
end;
|
||||||
@ -77,30 +77,30 @@ end;
|
|||||||
//Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal); cdecl; external 'c' name 'cfsetospeed';
|
//Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal); cdecl; external 'c' name 'cfsetospeed';
|
||||||
//Procedure CFMakeRaw(var tios:TermIOS); cdecl; external 'c' name 'cfmakeraw';
|
//Procedure CFMakeRaw(var tios:TermIOS); cdecl; external 'c' name 'cfmakeraw';
|
||||||
|
|
||||||
Function TCSendBreak(fd,duration:cint):cint;
|
Function TCSendBreak(fd,duration:cint):cint;{$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCSendBreak:=fpIOCtl(fd,TIOCSBRK,nil);
|
TCSendBreak:=fpIOCtl(fd,TIOCSBRK,nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TCSetPGrp(fd,id:cint):cint;
|
Function TCSetPGrp(fd,id:cint):cint;{$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCSetPGrp:=fpIOCtl(fd,TIOCSPGRP,pointer(id));
|
TCSetPGrp:=fpIOCtl(fd,TIOCSPGRP,pointer(id));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TCGetPGrp(fd:cint;var id:cint):cint;
|
Function TCGetPGrp(fd:cint;var id:cint):cint;{$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCGetPGrp:=fpIOCtl(fd,TIOCGPGRP,@id);
|
TCGetPGrp:=fpIOCtl(fd,TIOCGPGRP,@id);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TCDrain(fd:cint):cint;
|
Function TCDrain(fd:cint):cint;{$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCDrain:=fpIOCtl(fd,TIOCDRAIN,nil); {Should set timeout to 1 first?}
|
TCDrain:=fpIOCtl(fd,TIOCDRAIN,nil); {Should set timeout to 1 first?}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TCFlow(fd,act:cint):cint;
|
Function TCFlow(fd,act:cint):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
case act OF
|
case act OF
|
||||||
TCOOFF : TCFlow:=fpIoctl(fd,TIOCSTOP,nil);
|
TCOOFF : TCFlow:=fpIoctl(fd,TIOCSTOP,nil);
|
||||||
@ -109,7 +109,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TCFlush(fd,qsel:cint):cint;
|
Function TCFlush(fd,qsel:cint):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCFlush:=fpIOCtl(fd,TIOCFLUSH,pointer(qsel));
|
TCFlush:=fpIOCtl(fd,TIOCFLUSH,pointer(qsel));
|
||||||
end;
|
end;
|
||||||
@ -125,7 +125,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function IsATTY(var f: text):cint;
|
Function IsATTY(var f: text):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
{
|
{
|
||||||
Idem as previous, only now for text variables.
|
Idem as previous, only now for text variables.
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,8 +80,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SemaphorePost(const FSem: Pointer);
|
procedure SemaphorePost(const FSem: Pointer);
|
||||||
|
{$ifdef VER2_0}
|
||||||
|
var
|
||||||
|
b : byte;
|
||||||
|
{$endif}
|
||||||
begin
|
begin
|
||||||
|
{$ifdef VER2_0}
|
||||||
|
b:=0;
|
||||||
|
fpwrite(PFilDes(FSem)^[1], b, 1);
|
||||||
|
{$else}
|
||||||
fpwrite(PFilDes(FSem)^[1], #0, 1);
|
fpwrite(PFilDes(FSem)^[1], #0, 1);
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SemaphoreDestroy(const FSem: Pointer);
|
procedure SemaphoreDestroy(const FSem: Pointer);
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
IOCtl and Termios calls
|
IOCtl and Termios calls
|
||||||
******************************************************************************}
|
******************************************************************************}
|
||||||
|
|
||||||
Function TCGetAttr(fd:cint;var tios:TermIOS):cint;
|
Function TCGetAttr(fd:cint;var tios:TermIOS):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCGETAttr:=fpIoCtl(Fd,TIOCGETA,@tios);
|
TCGETAttr:=fpIoCtl(Fd,TIOCGETA,@tios);
|
||||||
end;
|
end;
|
||||||
@ -43,13 +43,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal);
|
Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
tios.c_ispeed:=speed; {Probably the Bxxxx speed constants}
|
tios.c_ispeed:=speed; {Probably the Bxxxx speed constants}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal);
|
Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
tios.c_ospeed:=speed;
|
tios.c_ospeed:=speed;
|
||||||
end;
|
end;
|
||||||
@ -73,30 +73,30 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TCSendBreak(fd,duration:cint):cint;
|
Function TCSendBreak(fd,duration:cint):cint;{$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCSendBreak:=fpIOCtl(fd,TIOCSBRK,nil);
|
TCSendBreak:=fpIOCtl(fd,TIOCSBRK,nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TCSetPGrp(fd,id:cint):cint;
|
Function TCSetPGrp(fd,id:cint):cint;{$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCSetPGrp:=fpIOCtl(fd,TIOCSPGRP,pointer(id));
|
TCSetPGrp:=fpIOCtl(fd,TIOCSPGRP,pointer(id));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TCGetPGrp(fd:cint;var id:cint):cint;
|
Function TCGetPGrp(fd:cint;var id:cint):cint;{$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCGetPGrp:=fpIOCtl(fd,TIOCGPGRP,@id);
|
TCGetPGrp:=fpIOCtl(fd,TIOCGPGRP,@id);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TCDrain(fd:cint):cint;
|
Function TCDrain(fd:cint):cint;{$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCDrain:=fpIOCtl(fd,TIOCDRAIN,nil); {Should set timeout to 1 first?}
|
TCDrain:=fpIOCtl(fd,TIOCDRAIN,nil); {Should set timeout to 1 first?}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TCFlow(fd,act:cint):cint;
|
Function TCFlow(fd,act:cint):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
case act OF
|
case act OF
|
||||||
TCOOFF : TCFlow:=fpIoctl(fd,TIOCSTOP,nil);
|
TCOOFF : TCFlow:=fpIoctl(fd,TIOCSTOP,nil);
|
||||||
@ -105,7 +105,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TCFlush(fd,qsel:cint):cint;
|
Function TCFlush(fd,qsel:cint):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
TCFlush:=fpIOCtl(fd,TIOCFLUSH,pointer(qsel));
|
TCFlush:=fpIOCtl(fd,TIOCFLUSH,pointer(qsel));
|
||||||
end;
|
end;
|
||||||
@ -121,7 +121,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function IsATTY(var f: text):cint;
|
Function IsATTY(var f: text):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
{
|
{
|
||||||
Idem as previous, only now for text variables.
|
Idem as previous, only now for text variables.
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,8 +81,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SemaphorePost(const FSem: Pointer);
|
procedure SemaphorePost(const FSem: Pointer);
|
||||||
|
{$ifdef VER2_0}
|
||||||
|
var
|
||||||
|
b : byte;
|
||||||
|
{$endif}
|
||||||
begin
|
begin
|
||||||
|
{$ifdef VER2_0}
|
||||||
|
b:=0;
|
||||||
|
fpwrite(PFilDes(FSem)^[1], b, 1);
|
||||||
|
{$else}
|
||||||
fpwrite(PFilDes(FSem)^[1], #0, 1);
|
fpwrite(PFilDes(FSem)^[1], #0, 1);
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SemaphoreDestroy(const FSem: Pointer);
|
procedure SemaphoreDestroy(const FSem: Pointer);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user