mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-28 05:04:13 +00:00
windows port
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10906 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
d7d540840a
commit
d72a4ea77d
@ -430,7 +430,11 @@ esl_status_t esl_listen(const char *host, esl_port_t port, esl_listen_callback_t
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
int client_sock;
|
int client_sock;
|
||||||
struct sockaddr_in echoClntAddr;
|
struct sockaddr_in echoClntAddr;
|
||||||
|
#ifdef WIN32
|
||||||
|
int clntLen;
|
||||||
|
#else
|
||||||
unsigned int clntLen;
|
unsigned int clntLen;
|
||||||
|
#endif
|
||||||
|
|
||||||
clntLen = sizeof(echoClntAddr);
|
clntLen = sizeof(echoClntAddr);
|
||||||
|
|
||||||
@ -572,8 +576,17 @@ esl_status_t esl_recv_event_timed(esl_handle_t *handle, uint32_t ms, esl_event_t
|
|||||||
esl_mutex_lock(handle->mutex);
|
esl_mutex_lock(handle->mutex);
|
||||||
FD_ZERO(&rfds);
|
FD_ZERO(&rfds);
|
||||||
FD_ZERO(&efds);
|
FD_ZERO(&efds);
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#pragma warning( push )
|
||||||
|
#pragma warning( disable : 4127 )
|
||||||
FD_SET(handle->sock, &rfds);
|
FD_SET(handle->sock, &rfds);
|
||||||
FD_SET(handle->sock, &efds);
|
FD_SET(handle->sock, &efds);
|
||||||
|
#pragma warning( pop )
|
||||||
|
#else
|
||||||
|
FD_SET(handle->sock, &rfds);
|
||||||
|
FD_SET(handle->sock, &efds);
|
||||||
|
#endif
|
||||||
|
|
||||||
max = handle->sock + 1;
|
max = handle->sock + 1;
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ esl_status_t esl_event_del_header(esl_event_t *event, const char *header_name)
|
|||||||
esl_assert(x < 1000);
|
esl_assert(x < 1000);
|
||||||
hash = esl_ci_hashfunc_default(header_name, &hlen);
|
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) {
|
if (lp) {
|
||||||
lp->next = hp->next;
|
lp->next = hp->next;
|
||||||
} else {
|
} else {
|
||||||
|
@ -168,7 +168,14 @@ typedef struct esl_event esl_event_t;
|
|||||||
#endif
|
#endif
|
||||||
#include <assert.h>
|
#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)
|
#define esl_assert(_x) assert(_x)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define esl_safe_free(_x) if (_x) free(_x); _x = NULL
|
#define esl_safe_free(_x) if (_x) free(_x); _x = NULL
|
||||||
#define esl_strlen_zero(s) (!s || *(s) == '\0')
|
#define esl_strlen_zero(s) (!s || *(s) == '\0')
|
||||||
#define esl_strlen_zero_buf(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 intptr_t esl_ssize_t;
|
||||||
typedef int esl_filehandle_t;
|
typedef int esl_filehandle_t;
|
||||||
#define ESL_SOCK_INVALID INVALID_SOCKET
|
#define ESL_SOCK_INVALID INVALID_SOCKET
|
||||||
|
#define strerror_r(num, buf, size) strerror_s(buf, size, num)
|
||||||
#else
|
#else
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user