Browse Source

* 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 -

Almindor 18 years ago
parent
commit
b0dabd0746
4 changed files with 81 additions and 4 deletions
  1. 1 0
      .gitattributes
  2. 61 0
      rtl/win/fpwinsockh.inc
  3. 1 4
      rtl/win/sockets.pp
  4. 18 0
      rtl/win/winsock2.pp

+ 1 - 0
.gitattributes

@@ -5295,6 +5295,7 @@ rtl/win/crt.pp svneol=native#text/plain
 rtl/win/dos.pp svneol=native#text/plain
 rtl/win/dos.pp svneol=native#text/plain
 rtl/win/dynlibs.inc svneol=native#text/plain
 rtl/win/dynlibs.inc svneol=native#text/plain
 rtl/win/fpcmemdll.pp 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/keyboard.pp svneol=native#text/plain
 rtl/win/messages.pp svneol=native#text/plain
 rtl/win/messages.pp svneol=native#text/plain
 rtl/win/mouse.pp svneol=native#text/plain
 rtl/win/mouse.pp svneol=native#text/plain

+ 61 - 0
rtl/win/fpwinsockh.inc

@@ -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;

+ 1 - 4
rtl/win/sockets.pp

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

+ 18 - 0
rtl/win/winsock2.pp

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