[Synalist] Code change request: synaip.hpp - StrToIp6 be made C++ friendly
Pascal TCP/IP Library
Brought to you by:
geby
From: Paul R. <pr...@nt...> - 2014-06-16 08:19:23
|
Hi Just upgraded to v40 and again have had to apply a mod to StrToIp6 so that the header does not throw a C++ builder compile time error: [BCC32 Error] Synaip.hpp(36): E2091 Functions cannot return arrays or functions Full parser context TSenderEmail.cpp(9): #include c:\dev\cmp\synapse\source\lib\smtpsend.hpp smtpsend.hpp(19): #include c:\dev\cmp\synapse\source\lib\Blcksock.hpp Blcksock.hpp(23): #include c:\dev\cmp\synapse\source\lib\Synaip.hpp Synaip.hpp(23): namespace Synaip PROPOSAL: function StrToIp6(value: string; ipv6Result: TIp6Bytes): Boolean; var IPv6: TIp6Words; Index: Integer; n: integer; b1, b2: byte; s: string; x: integer; begin Result := False; for n := 0 to 15 do ipv6Result[n] := 0; for n := 0 to 7 do Ipv6[n] := 0; Index := 0; Value := ExpandIP6(value); if value = '' then exit; while Value <> '' do begin if Index > 7 then Exit; s := fetch(value, ':'); if s = '@' then break; if s = '' then begin IPv6[Index] := 0; end else begin x := StrToIntDef('$' + s, -1); if (x > 65535) or (x < 0) then Exit; IPv6[Index] := x; end; Inc(Index); end; for n := 0 to 7 do begin b1 := ipv6[n] div 256; b2 := ipv6[n] mod 256; ipv6Result[n * 2] := b1; ipv6Result[(n * 2) + 1] := b2; end; Result := true; end; And related changes in blcksend.pas (If you would be so kind) Thanks Paul Read nSolve |