On Tue, 14 Jun 2005, Koenraad Lelong wrote:
> 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; You must switch the order of the units, because you get the 'oldlinux' types which you try to use in 'baseunix' functions. You can drop the oldlinux altogether. The program compiles as follows: uses baseunix,unixtype; 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.tv_sec:=0; tval.tv_usec:=10000; if fpSelect(fd+1,@filedescr,nil,nil,@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; begin end. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal