Commit 0c086e3c authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Fix compilation for win32native with Visual Studio.

parent 5779aa06
...@@ -210,6 +210,10 @@ ...@@ -210,6 +210,10 @@
RelativePath="..\..\src\jitterctl.c" RelativePath="..\..\src\jitterctl.c"
> >
</File> </File>
<File
RelativePath="..\..\src\logging.c"
>
</File>
<File <File
RelativePath="..\..\src\netsim.c" RelativePath="..\..\src\netsim.c"
> >
...@@ -246,6 +250,10 @@ ...@@ -246,6 +250,10 @@
RelativePath="..\..\src\rtpparse.c" RelativePath="..\..\src\rtpparse.c"
> >
</File> </File>
<File
RelativePath="..\..\src\rtpprofile.c"
>
</File>
<File <File
RelativePath="..\..\src\rtpsession.c" RelativePath="..\..\src\rtpsession.c"
> >
...@@ -312,6 +320,10 @@ ...@@ -312,6 +320,10 @@
RelativePath="..\..\src\jitterctl.h" RelativePath="..\..\src\jitterctl.h"
> >
</File> </File>
<File
RelativePath="..\..\include\ortp\logging.h"
>
</File>
<File <File
RelativePath="..\..\src\ortp-config-win32.h" RelativePath="..\..\src\ortp-config-win32.h"
> >
...@@ -344,6 +356,10 @@ ...@@ -344,6 +356,10 @@
RelativePath="..\..\src\rtpmod.h" RelativePath="..\..\src\rtpmod.h"
> >
</File> </File>
<File
RelativePath="..\..\include\ortp\rtpprofile.h"
>
</File>
<File <File
RelativePath="..\..\include\ortp\rtpsession.h" RelativePath="..\..\include\ortp\rtpsession.h"
> >
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "ortp/logging.h" #include "ortp/logging.h"
#include "ortp/port.h" #include "ortp/port.h"
#include "ortp/str_utils.h" #include "ortp/str_utils.h"
#include "utils.h"
#if defined(_WIN32) && !defined(_WIN32_WCE) #if defined(_WIN32) && !defined(_WIN32_WCE)
#include <process.h> #include <process.h>
......
...@@ -59,6 +59,7 @@ typedef WSACMSGHDR *LPWSACMSGHDR; ...@@ -59,6 +59,7 @@ typedef WSACMSGHDR *LPWSACMSGHDR;
#define WSA_CMSG_FIRSTHDR(msg) (((msg)->Control.len >= sizeof(WSACMSGHDR)) ? (LPWSACMSGHDR)(msg)->Control.buf : (LPWSACMSGHDR)NULL) #define WSA_CMSG_FIRSTHDR(msg) (((msg)->Control.len >= sizeof(WSACMSGHDR)) ? (LPWSACMSGHDR)(msg)->Control.buf : (LPWSACMSGHDR)NULL)
#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)))) #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))))
#define WSA_CMSG_DATA(cmsg) ((u_char *)(cmsg) + WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR))) #define WSA_CMSG_DATA(cmsg) ((u_char *)(cmsg) + WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR)))
#endif
#undef CMSG_FIRSTHDR #undef CMSG_FIRSTHDR
#define CMSG_FIRSTHDR WSA_CMSG_FIRSTHDR #define CMSG_FIRSTHDR WSA_CMSG_FIRSTHDR
#undef CMSG_NXTHDR #undef CMSG_NXTHDR
...@@ -68,7 +69,6 @@ typedef WSACMSGHDR *LPWSACMSGHDR; ...@@ -68,7 +69,6 @@ typedef WSACMSGHDR *LPWSACMSGHDR;
typedef INT (WINAPI * LPFN_WSARECVMSG)(SOCKET, LPWSAMSG, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE); typedef INT (WINAPI * LPFN_WSARECVMSG)(SOCKET, LPWSAMSG, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
static LPFN_WSARECVMSG ortp_WSARecvMsg = NULL; static LPFN_WSARECVMSG ortp_WSARecvMsg = NULL;
#endif #endif
#endif
static bool_t try_connect(int fd, const struct sockaddr *dest, socklen_t addrlen){ static bool_t try_connect(int fd, const struct sockaddr *dest, socklen_t addrlen){
if (connect(fd,dest,addrlen)<0){ if (connect(fd,dest,addrlen)<0){
...@@ -1164,7 +1164,7 @@ int rtp_session_rtp_recv_abstract(ortp_socket_t socket, mblk_t *msg, int flags, ...@@ -1164,7 +1164,7 @@ int rtp_session_rtp_recv_abstract(ortp_socket_t socket, mblk_t *msg, int flags,
} }
#endif #endif
#ifdef IPV6_RECVDSTADDR #ifdef IPV6_RECVDSTADDR
if ((cmsghdr->cmsg_level == IPPROTO_IPV6) && (cmsg->cmsg_type == IPV6_RECVDSTADDR)) { if ((cmsghdr->cmsg_level == IPPROTO_IPV6) && (cmsghdr->cmsg_type == IPV6_RECVDSTADDR)) {
struct in6_addr *ia = (struct in6_addr *)CMSG_DATA(cmsghdr); struct in6_addr *ia = (struct in6_addr *)CMSG_DATA(cmsghdr);
memcpy(&msg->recv_addr.addr.ipi6_addr, ia, sizeof(msg->recv_addr.addr.ipi6_addr)); memcpy(&msg->recv_addr.addr.ipi6_addr, ia, sizeof(msg->recv_addr.addr.ipi6_addr));
msg->recv_addr.family = AF_INET6; msg->recv_addr.family = AF_INET6;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment