windows port

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10906 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-12-22 05:37:54 +00:00
parent d7d540840a
commit d72a4ea77d
3 changed files with 25 additions and 4 deletions

View File

@ -429,8 +429,12 @@ esl_status_t esl_listen(const char *host, esl_port_t port, esl_listen_callback_t
for (;;) {
int client_sock;
struct sockaddr_in echoClntAddr;
unsigned int clntLen;
struct sockaddr_in echoClntAddr;
#ifdef WIN32
int clntLen;
#else
unsigned int clntLen;
#endif
clntLen = sizeof(echoClntAddr);
@ -572,9 +576,18 @@ esl_status_t esl_recv_event_timed(esl_handle_t *handle, uint32_t ms, esl_event_t
esl_mutex_lock(handle->mutex);
FD_ZERO(&rfds);
FD_ZERO(&efds);
#ifdef WIN32
#pragma warning( push )
#pragma warning( disable : 4127 )
FD_SET(handle->sock, &rfds);
FD_SET(handle->sock, &efds);
#pragma warning( pop )
#else
FD_SET(handle->sock, &rfds);
FD_SET(handle->sock, &efds);
#endif
max = handle->sock + 1;
if ((activity = select(max, &rfds, NULL, &efds, &tv)) < 0) {

View File

@ -255,7 +255,7 @@ esl_status_t esl_event_del_header(esl_event_t *event, const char *header_name)
esl_assert(x < 1000);
hash = esl_ci_hashfunc_default(header_name, &hlen);
if ((!hp->hash || hash == hp->hash) && !strcasecmp(header_name, hp->name)) {
if (hp->name && (!hp->hash || hash == hp->hash) && !strcasecmp(header_name, hp->name)) {
if (lp) {
lp->next = hp->next;
} else {

View File

@ -167,8 +167,15 @@ typedef struct esl_event esl_event_t;
#include <strings.h>
#endif
#include <assert.h>
#if (_MSC_VER >= 1400) // VC8+
#define esl_assert(expr) assert(expr);__analysis_assume( expr )
#endif
#ifndef esl_assert
#define esl_assert(_x) assert(_x)
#endif
#define esl_safe_free(_x) if (_x) free(_x); _x = NULL
#define esl_strlen_zero(s) (!s || *(s) == '\0')
#define esl_strlen_zero_buf(s) (*(s) == '\0')
@ -188,6 +195,7 @@ typedef __int8 int8_t;
typedef intptr_t esl_ssize_t;
typedef int esl_filehandle_t;
#define ESL_SOCK_INVALID INVALID_SOCKET
#define strerror_r(num, buf, size) strerror_s(buf, size, num)
#else
#include <stdint.h>
#include <sys/types.h>