sswin32.pas - improved D2009 compatibility

git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@122 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
geby
2010-02-03 09:21:44 +00:00
parent 583afbc35e
commit 5e3d01a8f5

View File

@@ -1183,10 +1183,10 @@ begin
Sin.sin_family := AF_INET; Sin.sin_family := AF_INET;
ProtoEnt := synsock.GetProtoByNumber(SockProtocol); ProtoEnt := synsock.GetProtoByNumber(SockProtocol);
ServEnt := nil; ServEnt := nil;
if (ProtoEnt <> nil) and (StrToIntDef(Port,-1) =-1) then if (ProtoEnt <> nil) and (StrToIntDef(string(Port),-1) =-1) then
ServEnt := synsock.GetServByName(PAnsiChar(Port), ProtoEnt^.p_name); ServEnt := synsock.GetServByName(PAnsiChar(Port), ProtoEnt^.p_name);
if ServEnt = nil then if ServEnt = nil then
Sin.sin_port := synsock.htons(StrToIntDef(Port, 0)) Sin.sin_port := synsock.htons(StrToIntDef(string(Port), 0))
else else
Sin.sin_port := ServEnt^.s_port; Sin.sin_port := ServEnt^.s_port;
if IP = cBroadcast then if IP = cBroadcast then
@@ -1298,7 +1298,7 @@ var
IP: u_long; IP: u_long;
PAdrPtr: PaPInAddr; PAdrPtr: PaPInAddr;
i: Integer; i: Integer;
s: AnsiString; s: String;
InAddr: TInAddr; InAddr: TInAddr;
begin begin
IPList.Clear; IPList.Clear;
@@ -1328,7 +1328,7 @@ begin
end; end;
end end
else else
IPList.Add(Name); IPList.Add(string(Name));
end end
else else
begin begin
@@ -1358,7 +1358,7 @@ begin
if r = 0 then if r = 0 then
begin begin
host := PAnsiChar(host); host := PAnsiChar(host);
IPList.Add(host); IPList.Add(string(host));
end; end;
end; end;
AddrNext := AddrNext^.ai_next; AddrNext := AddrNext^.ai_next;
@@ -1391,7 +1391,7 @@ begin
if ProtoEnt <> nil then if ProtoEnt <> nil then
ServEnt := synsock.GetServByName(PAnsiChar(Port), ProtoEnt^.p_name); ServEnt := synsock.GetServByName(PAnsiChar(Port), ProtoEnt^.p_name);
if ServEnt = nil then if ServEnt = nil then
Result := StrToIntDef(Port, 0) Result := StrToIntDef(string(Port), 0)
else else
Result := synsock.htons(ServEnt^.s_port); Result := synsock.htons(ServEnt^.s_port);
finally finally
@@ -1596,4 +1596,4 @@ end;
finalization finalization
begin begin
SynSockCS.Free; SynSockCS.Free;
end; end;