Commit 708e615a authored by Michael Jerris's avatar Michael Jerris

Windows type fixes

darcs-hash:20060919204205-16063-ee2f4272ebc27ca2de818172c1403611438e4d82.gz
parent dfa9fc27
......@@ -4018,7 +4018,7 @@ int leg_route(nta_leg_t *leg,
#else
if (r && r->r_url->url_params)
leg->leg_loose_route = url_has_param(r->r_url->url_params, "lr");
leg->leg_loose_route = url_has_param(r->r_url, "lr");
if (contact) {
sip_contact_t m[1], *m0;
......
......@@ -65,7 +65,38 @@ typedef unsigned _int32 uint32_t;
#if HAVE_WINSOCK2_H
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#include <time.h>
#include "sofia-resolv/sres.h"
#include "sofia-resolv/sres_cache.h"
#include "sofia-resolv/sres_record.h"
#include "sofia-resolv/sres_async.h"
#include <sofia-sip/su_alloc.h>
#include <sofia-sip/su_strlst.h>
#include <sofia-sip/su_errno.h>
#include "sofia-sip/htable.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <limits.h>
#include <assert.h>
#if HAVE_WINSOCK2_H
/* Posix send() */
static inline
ssize_t sres_send(sres_socket_t s, void *b, size_t len, int flags)
......@@ -79,16 +110,15 @@ ssize_t sres_recvfrom(sres_socket_t s, void *b, size_t len, int flags,
struct sockaddr *from, socklen_t *fromlen)
{
int ilen;
int retval;
if (fromlen)
ilen = *fromlen;
int retval = recvfrom(s, b, len, flags, from, fromlen ? &ilen : NULL);
retval = recvfrom(s, b, len, flags, from, fromlen ? &ilen : NULL);
if (fromlen)
*fromlen = ilen;
return (ssize_t)retval;
}
#define close(s) closesocket(s)
#if !defined(IPPROTO_IPV6)
#if HAVE_SIN6
#include <tpipv6.h>
......@@ -118,35 +148,6 @@ int inet_pton(int af, char const *src, void *dst);
const char *inet_ntop(int af, void const *src, char *dst, size_t size);
#endif
#include <time.h>
#include "sofia-resolv/sres.h"
#include "sofia-resolv/sres_cache.h"
#include "sofia-resolv/sres_record.h"
#include "sofia-resolv/sres_async.h"
#include <sofia-sip/su_alloc.h>
#include <sofia-sip/su_strlst.h>
#include <sofia-sip/su_errno.h>
#include "sofia-sip/htable.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <limits.h>
#include <assert.h>
#if defined(va_copy)
#elif defined(__va_copy)
#define va_copy(dst, src) __va_copy((dst), (src))
......
......@@ -52,6 +52,11 @@
#include <sofia-sip/su.h>
#include <sofia-sip/su_localinfo.h>
#if HAVE_WINSOCK2_H
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#if defined(HAVE_OPENSSL)
#include <openssl/opensslv.h>
#endif
......@@ -1715,7 +1720,7 @@ static int stun_bind_callback(stun_magic_t *m, su_wait_t *w, su_wakeup_arg_t *ar
/* receive response */
recv_len = sizeof(recv);
dgram_len = su_recvfrom(s, dgram, sizeof(dgram), 0, &recv, &recv_len);
dgram_len = su_recvfrom(s, dgram, sizeof(dgram), 0, (struct sockaddr *)(&recv), &recv_len);
err = errno;
if ((dgram_len < 0) && (err != EAGAIN)) {
/* su_wait_destroy(w); */
......
......@@ -137,7 +137,6 @@ stun_dns_lookup_t *stun_dns_lookup(stun_magic_t *magic,
{
stun_dns_lookup_t *self = su_zalloc(NULL, sizeof(stun_dns_lookup_t));
sres_query_t *query;
su_socket_t socket;
/* see nta.c:outgoing_answer_srv() */
......
......@@ -281,8 +281,8 @@ SOFIAPUBFUN ssize_t
su_send(su_socket_t s, void *buffer, size_t length, int flags),
su_sendto(su_socket_t s, void *buffer, size_t length, int flags,
su_sockaddr_t const *to, socklen_t tolen),
su_recv(sres_socket_t s, void *buffer, size_t length, int flags),
su_recvfrom(sres_socket_t s, void *buffer, size_t length, int flags,
su_recv(su_socket_t s, void *buffer, size_t length, int flags),
su_recvfrom(su_socket_t s, void *buffer, size_t length, int flags,
struct sockaddr *from, socklen_t *fromlen);
#else
#define su_send(s,b,l,f) send((s),(b),(l),(f))
......
......@@ -227,7 +227,7 @@ ssize_t su_sendto(su_socket_t s, void *buffer, size_t length, int flags,
(void *)to, (int) tolen);
}
ssize_t su_recv(sres_socket_t s, void *buffer, size_t length, int flags)
ssize_t su_recv(su_socket_t s, void *buffer, size_t length, int flags)
{
if (length > INT_MAX)
length = INT_MAX;
......@@ -235,7 +235,7 @@ ssize_t su_recv(sres_socket_t s, void *buffer, size_t length, int flags)
return (ssize_t)recv(s, buffer, (int)length, flags);
}
ssize_t su_recvfrom(sres_socket_t s, void *buffer, size_t length, int flags,
ssize_t su_recvfrom(su_socket_t s, void *buffer, size_t length, int flags,
struct sockaddr *from, socklen_t *fromlen)
{
int retval, ilen;
......
......@@ -460,6 +460,12 @@
#endif // VC8+
#endif
#ifdef WIN32
#ifndef UINT32_MAX
#define UINT32_MAX 0xffffffff
#endif
#endif
/* size_t/ssize_t modifiers
* ref: http://msdn2.microsoft.com/en-us/library/tcxf1dw6.aspx */
#define MOD_ZD "%ld"
......
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