From 067afdf3d35fc5c3e3f62040d0b302f5972cdfe2 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 11 Dec 2007 15:58:20 +0000 Subject: [PATCH] fix for msvc 9 build. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6644 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c | 2 +- libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su.h | 2 +- libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h | 6 ++++++ libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c | 2 +- libs/sofia-sip/win32/config.h.in | 6 ++++++ libs/sofia-sip/win32/sofia-sip/su_configure.h | 7 ++++++- 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c b/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c index a8d7fb5b38..c5a0389c54 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c +++ b/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c @@ -141,7 +141,7 @@ int sres_close(sres_socket_t s) return closesocket(s); } -#if !defined(IPPROTO_IPV6) +#if !defined(IPPROTO_IPV6) && (_WIN32_WINNT < 0x0600) #if HAVE_SIN6 #include #else diff --git a/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su.h b/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su.h index 4370f958c3..2b1eb66007 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su.h +++ b/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su.h @@ -67,7 +67,7 @@ # include # include # if SU_HAVE_IN6 -# if defined(IPPROTO_IPV6) +# if defined(IPPROTO_IPV6) || (_WIN32_WINNT >= 0x0600) /* case 1: IPv6 defined in winsock2.h/ws2tcpip.h */ # else /* case 2: try to use "IPv6 Tech Preview" */ diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h b/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h index cf3b2205d0..2517fa9d5f 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h @@ -67,6 +67,12 @@ #define MSG_NOSIGNAL (0) #endif +#if (_WIN32_WINNT >= 0x0600) +#ifndef HAVE_MSG_TRUNC +#define HAVE_MSG_TRUNC 1 +#endif +#endif + #if !HAVE_MSG_TRUNC #define MSG_TRUNC (0) #endif diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c index 74e15b38a3..d843fb7cfb 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c @@ -196,7 +196,7 @@ static void tport_check_trunc(tport_t *tp, su_addrinfo_t *ai) n = su_sendto(tp->tp_socket, "TEST", 4, 0, - (void *)ai->ai_addr, ai->ai_addrlen); + (void *)ai->ai_addr, (socklen_t)ai->ai_addrlen); if (n != 4) return; diff --git a/libs/sofia-sip/win32/config.h.in b/libs/sofia-sip/win32/config.h.in index 8d10097d79..5bbca9de84 100644 --- a/libs/sofia-sip/win32/config.h.in +++ b/libs/sofia-sip/win32/config.h.in @@ -457,7 +457,13 @@ #define strncasecmp _strnicmp #define snprintf _snprintf + +#ifndef _MSC_VER #define vsnprintf _vsnprintf +#endif +#if _MSC_VER < 1500 +#define vsnprintf _vsnprintf +#endif #define srandom(x) srand((x)) #define random() rand() diff --git a/libs/sofia-sip/win32/sofia-sip/su_configure.h b/libs/sofia-sip/win32/sofia-sip/su_configure.h index c6c3b89075..8d01703a1e 100644 --- a/libs/sofia-sip/win32/sofia-sip/su_configure.h +++ b/libs/sofia-sip/win32/sofia-sip/su_configure.h @@ -104,7 +104,12 @@ #define snprintf _snprintf #endif #ifndef vsnprintf -#define vsnprintf _vsnprintf +#ifndef _MSC_VER +#define vsnprintf _vsnprintf +#endif +#if _MSC_VER < 1500 +#define vsnprintf _vsnprintf +#endif #endif #define srandom(x) srand((x))