提交 067afdf3 authored 作者: Michael Jerris's avatar Michael Jerris

fix for msvc 9 build.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6644 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 cfcc114b
...@@ -141,7 +141,7 @@ int sres_close(sres_socket_t s) ...@@ -141,7 +141,7 @@ int sres_close(sres_socket_t s)
return closesocket(s); return closesocket(s);
} }
#if !defined(IPPROTO_IPV6) #if !defined(IPPROTO_IPV6) && (_WIN32_WINNT < 0x0600)
#if HAVE_SIN6 #if HAVE_SIN6
#include <tpipv6.h> #include <tpipv6.h>
#else #else
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
# include <winsock2.h> # include <winsock2.h>
# include <ws2tcpip.h> # include <ws2tcpip.h>
# if SU_HAVE_IN6 # if SU_HAVE_IN6
# if defined(IPPROTO_IPV6) # if defined(IPPROTO_IPV6) || (_WIN32_WINNT >= 0x0600)
/* case 1: IPv6 defined in winsock2.h/ws2tcpip.h */ /* case 1: IPv6 defined in winsock2.h/ws2tcpip.h */
# else # else
/* case 2: try to use "IPv6 Tech Preview" */ /* case 2: try to use "IPv6 Tech Preview" */
......
...@@ -67,6 +67,12 @@ ...@@ -67,6 +67,12 @@
#define MSG_NOSIGNAL (0) #define MSG_NOSIGNAL (0)
#endif #endif
#if (_WIN32_WINNT >= 0x0600)
#ifndef HAVE_MSG_TRUNC
#define HAVE_MSG_TRUNC 1
#endif
#endif
#if !HAVE_MSG_TRUNC #if !HAVE_MSG_TRUNC
#define MSG_TRUNC (0) #define MSG_TRUNC (0)
#endif #endif
......
...@@ -196,7 +196,7 @@ static void tport_check_trunc(tport_t *tp, su_addrinfo_t *ai) ...@@ -196,7 +196,7 @@ static void tport_check_trunc(tport_t *tp, su_addrinfo_t *ai)
n = su_sendto(tp->tp_socket, n = su_sendto(tp->tp_socket,
"TEST", 4, 0, "TEST", 4, 0,
(void *)ai->ai_addr, ai->ai_addrlen); (void *)ai->ai_addr, (socklen_t)ai->ai_addrlen);
if (n != 4) if (n != 4)
return; return;
......
...@@ -457,7 +457,13 @@ ...@@ -457,7 +457,13 @@
#define strncasecmp _strnicmp #define strncasecmp _strnicmp
#define snprintf _snprintf #define snprintf _snprintf
#ifndef _MSC_VER
#define vsnprintf _vsnprintf
#endif
#if _MSC_VER < 1500
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf
#endif
#define srandom(x) srand((x)) #define srandom(x) srand((x))
#define random() rand() #define random() rand()
......
...@@ -104,7 +104,12 @@ ...@@ -104,7 +104,12 @@
#define snprintf _snprintf #define snprintf _snprintf
#endif #endif
#ifndef vsnprintf #ifndef vsnprintf
#define vsnprintf _vsnprintf #ifndef _MSC_VER
#define vsnprintf _vsnprintf
#endif
#if _MSC_VER < 1500
#define vsnprintf _vsnprintf
#endif
#endif #endif
#define srandom(x) srand((x)) #define srandom(x) srand((x))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论