[fpc-pascal] using oldlinux
Koenraad Lelong
fpascal at brouwerij.homelinux.net
Tue Jun 14 06:09:22 CEST 2005
Hi,
Anyone has suggestions why I can't compile the following :
unit test1;
interface
function ReadCOM(portnum : integer; inlen : integer; var inbuf : array
of byte) : integer;
implementation
uses baseunix, oldlinux;
function ReadCOM(portnum : integer; inlen : integer; var inbuf : array
of byte) : integer;
var
fd : integer;
filedescr : TFDSet;
tval : timeval;
cnt : integer;
timeout : boolean;
begin
fpFD_ZERO(filedescr);
fpFD_SET(fd,filedescr);
tval.sec:=0;
tval.usec:=10000;
if fpSelect(fd+1, at filedescr,nil,nil, at tval)>0 then
if fpread(fd,inbuf[cnt],1)<>1 then
timeout:=true
else
inc(cnt)
else timeout:=true;
if not timeout then
ReadCom:=inlen
else
ReadCom:=cnt;
end;
end.
I'm getting the following error :
test1(22,21) Error: call by var parameters have to match exactly: Got
"fdSet" expected "TFDSet"
test1(23,23) Error: call by var parameters have to match exactly: Got
"fdSet" expected "TFDSet"
I changed filedescr to fdset and back to TFDSet with the same result.
That's with FPC 2.0.0.
TIA
Koenraad Lelong.
More information about the fpc-pascal
mailing list