Hi coding m8s!
I've recently upgraded my iMac to SSD with fresh and clean El Capitan installation. On the "old" system I was using Lazarus trunk svn and fpc 2.6.4. Then I've installed all latest developer tools and started testing if all is still working. Sadly Lazarus 1.6 RC2 with fpc 3.0.0 and fpcsrc 3.0.0 is not working as supposed... My projects are complaining about few things:
1:
Error: illegal expressionsolved with:
s := copy(s, 2, length(s));
yes, it was an actual bug in the code... but why on the old system it was ok and now it's an error?
going forward 2:
(preemption, i'm using lNet on my network stack, this is my utility function that gets me the ip of the host i'm trying to contact)
var
s: longint;
l: Integer;
lsa: TLSocketAddress;
sa: psockaddr;
sl: TSocklen;
begin
result := '';
FillAddressInfo(lsa, AF_INET, address, Port);
s := fpSocket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
sa := psockaddr(@lsa.IPv4);
sl := Sizeof(lsa.IPv4);
l := fpConnect(s, sa, sl);
l := LSocketError();
if IsBlockError(l) then
if l <> 0 then
begin
result := '0.0.0.0';
exit;
end;
lsa.IPv4.sin_addr.s_addr := 0;
l := Sizeof(lsa);
fpgetsockname(s, @lsa, @l);
result := NetAddrToStr(lsa.IPv4.addr); <--- Error here
CloseSocket(s);
Error: identifier idents no member "addr" (on line 29)
solved with:
result := NetAddrToStr(lsa.IPv4.sin_addr.s_addr);
Last one took a bit to digg out and after all that digging this is what came out:
*
Units StrUtils, DateUtils and Sockets can't be found by Lazarus, are there some replacement units?;
* If I comment one of units that Lazarus can't find I get a train full of errors;
* dateutils.inc is not included by anyone in fpcsrc, and there is no dateutils.pas/pp/p, do Lazarus look inside .inc sources for units?;
*
The above units are also missing in 3.0.0 makefile http://svn.freepascal.org/svn/fpc/trunk/rtl/darwin/Makefile.fpc while there were present in 2.6.4;* Why lNet is shipped as part of fpcsrc, doesn't this create some confusion when I put my customized lNet inside Lazarus components folder?;
* sockaddr_in record, that is the IPv4 of TLSocketAddress inside socketsh.inc, was changed?.
Can you help me solve all or part of my issues?