Bug 1033171 - Fix building SCTP on Windows with clang-cl; r=jesup

Upstream bug: https://code.google.com/p/sctp-refimpl/issues/detail?id=5
This commit is contained in:
Ehsan Akhgari 2014-07-02 10:31:18 -04:00
parent 3c872201a0
commit 749d42ac21
2 changed files with 14 additions and 6 deletions

View File

@ -217,11 +217,6 @@ typedef HANDLE userland_thread_t;
typedef char* caddr_t;
int Win_getifaddrs(struct ifaddrs**);
#define getifaddrs(interfaces) (int)Win_getifaddrs(interfaces)
int win_if_nametoindex(const char *);
#define if_nametoindex(x) win_if_nametoindex(x)
#define bzero(buf, len) memset(buf, 0, len)
#define bcopy(srcKey, dstKey, len) memcpy(dstKey, srcKey, len)
#define snprintf(data, size, format, name) _snprintf_s(data, size, _TRUNCATE, format, name)
@ -399,6 +394,11 @@ struct udphdr {
unsigned __int16 uh_sum;
};
int Win_getifaddrs(struct ifaddrs**);
#define getifaddrs(interfaces) (int)Win_getifaddrs(interfaces)
int win_if_nametoindex(const char *);
#define if_nametoindex(x) win_if_nametoindex(x)
#else /* !defined(Userspace_os_Windows) */
#include <sys/cdefs.h> /* needed? added from old __FreeBSD__ */
#include <sys/socket.h>

View File

@ -41,7 +41,15 @@
#include <strings.h>
#include <stdint.h>
#else
#include "netinet/sctp_os_userspace.h"
#if defined(_MSC_VER) && _MSC_VER >= 1600
#include <stdint.h>
#elif defined(SCTP_STDINT_INCLUDE)
#include SCTP_STDINT_INCLUDE
#else
#define uint32_t unsigned __int32
#define uint64_t unsigned __int64
#endif
#include <winsock2.h>
#endif
#define MINALLOCSIZE UMA_SMALLEST_UNIT