summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-09-27 09:35:34 +0000
committerBenny Prijono <bennylp@teluu.com>2008-09-27 09:35:34 +0000
commitfd557a69a1d827dcf04a596f0d4bb222101e3e21 (patch)
tree4a25b5079de30af3bad4447ffaa416778011bd40
parent0274356c3684e840b80c2861cf9f31c15e99e08c (diff)
Fixed ticket #644 and #648: incorrect muticast related socket constant names, missing ws2tcpip.h include causing build error on Mingw, and error building on Visual Studio 6 due to PJ_SOCK_HAS_GETADDRINFO being declared accidentally.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2327 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjlib/include/pj/compat/socket.h9
-rw-r--r--pjlib/src/pj/sock_bsd.c10
-rw-r--r--pjlib/src/pj/sock_symbian.cpp10
3 files changed, 17 insertions, 12 deletions
diff --git a/pjlib/include/pj/compat/socket.h b/pjlib/include/pj/compat/socket.h
index d234aca2..f173e8f8 100644
--- a/pjlib/include/pj/compat/socket.h
+++ b/pjlib/include/pj/compat/socket.h
@@ -53,14 +53,15 @@
* These VS uses Microsoft Platform SDK for Windows Server 2003 SP1, and
* it has built-in IPv6 support.
*/
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0
# ifndef s_addr
# define s_addr S_un.S_addr
# endif
# include <ws2tcpip.h>
+# define PJ_WS2TCPIP_H_INCLUDED
-# if !defined(IPPROTO_IPV6) && defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0
+# if !defined(IPPROTO_IPV6)
/* Need to download and install IPv6Kit for this platform.
* Please see the comments above about Visual Studio 6.
*/
@@ -70,6 +71,10 @@
# define PJ_SOCK_HAS_GETADDRINFO 1
#endif /* _MSC_VER */
+/* Mingw32 needs ws2tcpip.h for the IGMP constants */
+#if defined(__GNUC__) && defined(WIN32) && !defined(PJ_WS2TCPIP_H_INCLUDED)
+# include <ws2tcpip.h>
+#endif
#if defined(PJ_HAS_SYS_TYPES_H) && PJ_HAS_SYS_TYPES_H != 0
# include <sys/types.h>
diff --git a/pjlib/src/pj/sock_bsd.c b/pjlib/src/pj/sock_bsd.c
index b66740cc..74142547 100644
--- a/pjlib/src/pj/sock_bsd.c
+++ b/pjlib/src/pj/sock_bsd.c
@@ -115,11 +115,11 @@ const pj_uint16_t PJ_IPTOS_MINCOST = 0x02;
const pj_uint16_t PJ_SO_TYPE = SO_TYPE;
const pj_uint16_t PJ_SO_RCVBUF = SO_RCVBUF;
const pj_uint16_t PJ_SO_SNDBUF = SO_SNDBUF;
-const pj_uint16_t pj_IP_MULTICAST_IF = IP_MULTICAST_IF;
-const pj_uint16_t pj_IP_MULTICAST_TTL = IP_MULTICAST_TTL;
-const pj_uint16_t pj_IP_MULTICAST_LOOP = IP_MULTICAST_LOOP;
-const pj_uint16_t pj_IP_ADD_MEMBERSHIP = IP_ADD_MEMBERSHIP;
-const pj_uint16_t pj_IP_DROP_MEMBERSHIP = IP_DROP_MEMBERSHIP;
+const pj_uint16_t PJ_IP_MULTICAST_IF = IP_MULTICAST_IF;
+const pj_uint16_t PJ_IP_MULTICAST_TTL = IP_MULTICAST_TTL;
+const pj_uint16_t PJ_IP_MULTICAST_LOOP = IP_MULTICAST_LOOP;
+const pj_uint16_t PJ_IP_ADD_MEMBERSHIP = IP_ADD_MEMBERSHIP;
+const pj_uint16_t PJ_IP_DROP_MEMBERSHIP = IP_DROP_MEMBERSHIP;
/* recv() and send() flags */
diff --git a/pjlib/src/pj/sock_symbian.cpp b/pjlib/src/pj/sock_symbian.cpp
index 82a5d90e..89c37236 100644
--- a/pjlib/src/pj/sock_symbian.cpp
+++ b/pjlib/src/pj/sock_symbian.cpp
@@ -66,11 +66,11 @@ const pj_uint16_t PJ_SO_RCVBUF = 0xFFFF;
const pj_uint16_t PJ_SO_SNDBUF = 0xFFFF;
/* IP multicast is also not supported. */
-const pj_uint16_t pj_IP_MULTICAST_IF = 0xFFFF;
-const pj_uint16_t pj_IP_MULTICAST_TTL = 0xFFFF;
-const pj_uint16_t pj_IP_MULTICAST_LOOP = 0xFFFF;
-const pj_uint16_t pj_IP_ADD_MEMBERSHIP = 0xFFFF;
-const pj_uint16_t pj_IP_DROP_MEMBERSHIP = 0xFFFF;
+const pj_uint16_t PJ_IP_MULTICAST_IF = 0xFFFF;
+const pj_uint16_t PJ_IP_MULTICAST_TTL = 0xFFFF;
+const pj_uint16_t PJ_IP_MULTICAST_LOOP = 0xFFFF;
+const pj_uint16_t PJ_IP_ADD_MEMBERSHIP = 0xFFFF;
+const pj_uint16_t PJ_IP_DROP_MEMBERSHIP = 0xFFFF;
/* Flags */
const int PJ_MSG_OOB = 0;