* fix windows sockets AT_ and PF_ (because of the unix changes)

* fix some missing T-less names for types in winsock2
+ add fpwinsockh.inc for windows specific consts needed to be delegated from winsock

git-svn-id: trunk@5442 -
This commit is contained in:
Almindor 2006-11-22 11:32:07 +00:00
parent 50995f965c
commit b0dabd0746
4 changed files with 81 additions and 4 deletions

1
.gitattributes vendored
View File

@ -5295,6 +5295,7 @@ rtl/win/crt.pp svneol=native#text/plain
rtl/win/dos.pp svneol=native#text/plain
rtl/win/dynlibs.inc svneol=native#text/plain
rtl/win/fpcmemdll.pp svneol=native#text/plain
rtl/win/fpwinsockh.inc svneol=native#text/plain
rtl/win/keyboard.pp svneol=native#text/plain
rtl/win/messages.pp svneol=native#text/plain
rtl/win/mouse.pp svneol=native#text/plain

61
rtl/win/fpwinsockh.inc Normal file
View File

@ -0,0 +1,61 @@
{
Should be aliases but I copy pasted them from winsock2 for now...
}
const
{ Address families. }
AF_UNSPEC = 0; { unspecified }
AF_UNIX = 1; { local to host (pipes, portals) }
AF_INET = 2; { internetwork: UDP, TCP, etc. }
AF_IMPLINK = 3; { arpanet imp addresses }
AF_PUP = 4; { pup protocols: e.g. BSP }
AF_CHAOS = 5; { mit CHAOS protocols }
AF_IPX = 6; { IPX and SPX }
AF_NS = 6; { XEROX NS protocols }
AF_ISO = 7; { ISO protocols }
AF_OSI = AF_ISO; { OSI is ISO }
AF_ECMA = 8; { european computer manufacturers }
AF_DATAKIT = 9; { datakit protocols }
AF_CCITT = 10; { CCITT protocols, X.25 etc }
AF_SNA = 11; { IBM SNA }
AF_DECnet = 12; { DECnet }
AF_DLI = 13; { Direct data link interface }
AF_LAT = 14; { LAT }
AF_HYLINK = 15; { NSC Hyperchannel }
AF_APPLETALK = 16; { AppleTalk }
AF_NETBIOS = 17; { NetBios-style addresses }
AF_VOICEVIEW = 18; { VoiceView }
AF_FIREFOX = 19; { FireFox }
AF_UNKNOWN1 = 20; { Somebody is using this! }
AF_BAN = 21; { Banyan }
AF_ATM = 22; // Native ATM Services
AF_INET6 = 23; // Internetwork Version 6
AF_MAX = 24;
PF_UNSPEC = AF_UNSPEC;
PF_UNIX = AF_UNIX;
PF_INET = AF_INET;
PF_IMPLINK = AF_IMPLINK;
PF_PUP = AF_PUP;
PF_CHAOS = AF_CHAOS;
PF_NS = AF_NS;
PF_IPX = AF_IPX;
PF_ISO = AF_ISO;
PF_OSI = AF_OSI;
PF_ECMA = AF_ECMA;
PF_DATAKIT = AF_DATAKIT;
PF_CCITT = AF_CCITT;
PF_SNA = AF_SNA;
PF_DECnet = AF_DECnet;
PF_DLI = AF_DLI;
PF_LAT = AF_LAT;
PF_HYLINK = AF_HYLINK;
PF_APPLETALK = AF_APPLETALK;
PF_VOICEVIEW = AF_VOICEVIEW;
PF_FIREFOX = AF_FIREFOX;
PF_UNKNOWN1 = AF_UNKNOWN1;
PF_BAN = AF_BAN;
PF_ATM = AF_ATM;
PF_INET6 = AF_INET6;
PF_MAX = AF_MAX;

View File

@ -28,11 +28,8 @@ Type
psocklen= ^tsocklen;
Const
AF_MAX = WinSock2.AF_MAX;
PF_MAX = AF_MAX;
{$i socketsh.inc}
{$i fpwinsockh.inc}
Implementation

View File

@ -52,12 +52,21 @@ type
fd_count: u_int;
fd_array: array[0..FD_SETSIZE-1] of TSocket;
end;
fdset = TFDSet;
PTimeVal = ^TTimeVal;
TTimeVal = record
tv_sec: Longint;
tv_usec: Longint;
end;
timeval = TTimeVal;
timezone = record
tz_minuteswest : longint;
tz_dsttime : longint;
end;
TTimeZone = timezone;
PTimeZone = ^TTimeZone;
const
IOCPARM_MASK = $7f;
@ -87,6 +96,7 @@ type
0: (h_addr_list: ^PChar);
1: (h_addr: ^PChar)
end;
hostent = THostEnt;
PNetEnt = ^TNetEnt;
TNetEnt = record
@ -95,6 +105,7 @@ type
n_addrtype: Smallint;
n_net: u_long;
end;
netent = TNetEnt;
PServEnt = ^TServEnt;
TServEnt = record
@ -108,6 +119,7 @@ type
s_proto: PChar;
{$endif WIN64}
end;
servent = TServEnt;
PProtoEnt = ^TProtoEnt;
TProtoEnt = record
@ -115,6 +127,7 @@ type
p_aliases: ^Pchar;
p_proto: Smallint;
end;
protoent = TProtoEnt;
const
@ -364,6 +377,7 @@ type
1: (S_un_w: SunW);
2: (S_addr: u_long);
end;
in_addr = TInAddr;
PSockAddrIn = ^TSockAddrIn;
TSockAddrIn = record
@ -375,6 +389,7 @@ type
1: (sa_family: u_short;
sa_data: array[0..13] of Char)
end;
sockaddr_in = TSockAddrIn;
{ Structure used by kernel to store most addresses. }
@ -387,6 +402,7 @@ type
sp_family: u_short;
sp_protocol: u_short;
end;
sockproto = TSockProto;
{ Structure used for manipulating linger option. }
PLinger = ^TLinger;
@ -625,6 +641,7 @@ type
lpVendorInfo : pchar; { 4 byte, ofs 396 }
{$endif win64}
end;
WSAData = TWSAData;
{ WSAOVERLAPPED = Record
Internal: LongInt;
@ -661,6 +678,7 @@ type
MaxSduSize, MinimumPolicedSize : LongInt;// In Bytes
end;
PFlowSpec = ^TFLOWSPEC;
flowspec = TFlowSpec;
TQualityOfService = record
SendingFlowspec: TFlowSpec; { the flow spec for data sending }