~ubuntu-branches/ubuntu/precise/libpgm/precise

« back to all changes in this revision

Viewing changes to openpgm/pgm/win/mingw32-runtime_3.13-1openpgm3.diff

  • Committer: Bazaar Package Importer
  • Author(s): Gabriel de Perthuis
  • Date: 2011-04-07 16:48:52 UTC
  • Revision ID: james.westby@ubuntu.com-20110407164852-8uamem42ojeptj6l
Tags: upstream-5.1.116~dfsg
ImportĀ upstreamĀ versionĀ 5.1.116~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -urN include-original/mswsock.h include/mswsock.h
 
2
--- include-original/mswsock.h  2009-08-21 22:41:22.000000000 +0800
 
3
+++ include/mswsock.h   2010-01-21 17:31:14.662159471 +0800
 
4
@@ -83,23 +83,19 @@
 
5
 } WSAMSG, *PWSAMSG, *LPWSAMSG;
 
6
 
 
7
 
 
8
-/* According to MSDN docs, the WSAMSG.Control buffer starts with a
 
9
-   cmsghdr header of the following form.  See also RFC 2292. */
 
10
-
 
11
-typedef struct wsacmsghdr {
 
12
-       UINT    cmsg_len;
 
13
-       INT     cmsg_level;
 
14
-       INT     cmsg_type;
 
15
-       /* followed by UCHAR cmsg_data[]; */
 
16
-} WSACMSGHDR;
 
17
-
 
18
-/* TODO: Standard Posix.1g macros as per RFC 2292, with WSA_uglification. */
 
19
-#if 0
 
20
-#define WSA_CMSG_FIRSTHDR(mhdr)
 
21
-#define WSA_CMSG_NXTHDR(mhdr, cmsg)
 
22
-#define WSA_CMSG_SPACE(length)
 
23
-#define WSA_CMSG_LEN(length)
 
24
-#endif
 
25
+ typedef struct _WSACMSGHDR {
 
26
+    SIZE_T cmsg_len;
 
27
+    INT cmsg_level;
 
28
+    INT cmsg_type;
 
29
+  } WSACMSGHDR,*PWSACMSGHDR,*LPWSACMSGHDR;
 
30
+
 
31
+#define WSA_CMSGHDR_ALIGN(length) (((length) + TYPE_ALIGNMENT(WSACMSGHDR)-1) & (~(TYPE_ALIGNMENT(WSACMSGHDR)-1)))
 
32
+#define WSA_CMSGDATA_ALIGN(length) (((length) + MAX_NATURAL_ALIGNMENT-1) & (~(MAX_NATURAL_ALIGNMENT-1)))
 
33
+#define WSA_CMSG_FIRSTHDR(msg) (((msg)->Control.len >= sizeof(WSACMSGHDR)) ? (LPWSACMSGHDR)(msg)->Control.buf : (LPWSACMSGHDR)NULL)
 
34
+#define WSA_CMSG_NXTHDR(msg,cmsg) ((!(cmsg)) ? WSA_CMSG_FIRSTHDR(msg) : ((((u_char *)(cmsg) + WSA_CMSGHDR_ALIGN((cmsg)->cmsg_len) + sizeof(WSACMSGHDR)) > (u_char *)((msg)->Control.buf) + (msg)->Control.len) ? (LPWSACMSGHDR)NULL : (LPWSACMSGHDR)((u_char *)(cmsg) + WSA_CMSGHDR_ALIGN((cmsg)->cmsg_len))))
 
35
+#define WSA_CMSG_DATA(cmsg) ((u_char *)(cmsg) + WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR)))
 
36
+#define WSA_CMSG_SPACE(length) (WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR) + WSA_CMSGHDR_ALIGN(length)))
 
37
+#define WSA_CMSG_LEN(length) (WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR)) + length)
 
38
+
 
39
+typedef INT  (WINAPI * LPFN_WSARECVMSG)(SOCKET, LPWSAMSG, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
 
40
+
 
41
 BOOL PASCAL DisconnectEx(SOCKET,LPOVERLAPPED,DWORD,DWORD);
 
42
 int PASCAL WSARecvMsg(SOCKET,LPWSAMSG,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
 
43
 
 
44
diff -urN include-original/ws2tcpip.h include/ws2tcpip.h
 
45
--- include-original/ws2tcpip.h 2009-08-21 22:41:42.000000000 +0800
 
46
+++ include/ws2tcpip.h  2009-08-21 22:42:15.000000000 +0800
 
47
@@ -78,6 +78,18 @@
 
48
 
 
49
 #define UDP_NOCHECKSUM 1
 
50
 
 
51
+/* RFC 3768 */
 
52
+#define MCAST_JOIN_GROUP       41
 
53
+#define MCAST_LEAVE_GROUP      42
 
54
+#define MCAST_BLOCK_SOURCE     43
 
55
+#define MCAST_UNBLOCK_SOURCE   44
 
56
+#define MCAST_JOIN_SOURCE_GROUP        45
 
57
+#define MCAST_LEAVE_SOURCE_GROUP       46
 
58
+#define MCAST_MSFILTER         47
 
59
+
 
60
+#define MCAST_EXCLUDE   0
 
61
+#define MCAST_INCLUDE   1
 
62
+
 
63
 /* INTERFACE_INFO iiFlags */
 
64
 #define IFF_UP  1
 
65
 #define IFF_BROADCAST   2
 
66
@@ -104,6 +116,7 @@
 
67
 #define AI_PASSIVE     1
 
68
 #define AI_CANONNAME   2
 
69
 #define AI_NUMERICHOST 4
 
70
+#define AI_ADDRCONFIG  0x20
 
71
 
 
72
 /* getaddrinfo error codes */
 
73
 #define EAI_AGAIN      WSATRY_AGAIN
 
74
@@ -132,6 +145,25 @@
 
75
        struct in_addr  imr_interface;
 
76
 };
 
77
 
 
78
+struct group_req {
 
79
+       u_long          gr_interface;
 
80
+       struct sockaddr_storage gr_group;
 
81
+};
 
82
+
 
83
+struct group_source_req {
 
84
+       u_long          gsr_interface;
 
85
+       struct sockaddr_storage gsr_group;
 
86
+       struct sockaddr_storage gsr_source;
 
87
+};
 
88
+
 
89
+struct group_filter {
 
90
+       u_long          gf_interface;
 
91
+       struct sockaddr_storage gf_group;
 
92
+       u_long          gf_fmode;
 
93
+       u_long          gf_numsrc;
 
94
+       struct sockaddr_storage gf_slist[1];
 
95
+};
 
96
+
 
97
 struct ip_msfilter {
 
98
        struct in_addr  imsf_multiaddr;
 
99
        struct in_addr  imsf_interface;
 
100
@@ -356,6 +388,13 @@
 
101
        sockaddr_gen    iiNetmask;
 
102
 } INTERFACE_INFO, *LPINTERFACE_INFO;
 
103
 
 
104
+typedef struct _INTERFACE_INFO_EX {
 
105
+       u_long          iiFlags;
 
106
+       SOCKET_ADDRESS  iiAddress;
 
107
+       SOCKET_ADDRESS  iiBroadcastAddress;
 
108
+       SOCKET_ADDRESS  iiNetmask;
 
109
+} INTERFACE_INFO_EX, *_LPINTERFACE_INFO_EX;
 
110
+
 
111
 /*
 
112
    The definition above can cause problems on NT4,prior to sp4.
 
113
    To workaround, include the following struct and typedef and
 
114
--- include-original/winnt.h    2009-08-21 22:41:42.000000000 +0800
 
115
+++ include/winnt.h     2010-01-21 17:33:56.366162880 +0800
 
116
@@ -43,6 +43,20 @@
 
117
 #define UNALIGNED
 
118
 #endif
 
119
 
 
120
+#ifdef _WIN64
 
121
+#define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG)
 
122
+#define MEMORY_ALLOCATION_ALIGNMENT 16
 
123
+#else
 
124
+#define MAX_NATURAL_ALIGNMENT sizeof(DWORD)
 
125
+#define MEMORY_ALLOCATION_ALIGNMENT 8
 
126
+#endif
 
127
+
 
128
+#ifdef __cplusplus
 
129
+#define TYPE_ALIGNMENT(t) __alignof__ (t)
 
130
+#else
 
131
+#define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; },test)
 
132
+#endif
 
133
+
 
134
 #ifndef DECLSPEC_ALIGN
 
135
 #ifdef __GNUC__
 
136
 #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))