mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
fix windows build
This commit is contained in:
parent
644a144e19
commit
b079eee5fb
@ -613,8 +613,9 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
|
|||||||
int rval = 0;
|
int rval = 0;
|
||||||
const char *hval;
|
const char *hval;
|
||||||
struct addrinfo hints = { 0 }, *result;
|
struct addrinfo hints = { 0 }, *result;
|
||||||
|
#ifndef WIN32
|
||||||
int fd_flags;
|
int fd_flags;
|
||||||
#ifdef WIN32
|
#else
|
||||||
WORD wVersionRequested = MAKEWORD(2, 0);
|
WORD wVersionRequested = MAKEWORD(2, 0);
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
int err = WSAStartup(wVersionRequested, &wsaData);
|
int err = WSAStartup(wVersionRequested, &wsaData);
|
||||||
@ -669,11 +670,20 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
|
|||||||
|
|
||||||
if (timeout != -1) {
|
if (timeout != -1) {
|
||||||
fd_set wfds;
|
fd_set wfds;
|
||||||
struct timeval tv = { timeout / 1000, (timeout % 1000) * 1000 };
|
struct timeval tv;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
tv.tv_sec = timeout / 1000;
|
||||||
|
tv.tv_usec = (timeout % 1000) * 1000;
|
||||||
FD_ZERO(&wfds);
|
FD_ZERO(&wfds);
|
||||||
|
#ifdef WIN32
|
||||||
|
#pragma warning( push )
|
||||||
|
#pragma warning( disable : 4127 )
|
||||||
|
FD_SET(handle->sock, &wfds);
|
||||||
|
#pragma warning( pop )
|
||||||
|
#else
|
||||||
FD_SET(handle->sock, &wfds);
|
FD_SET(handle->sock, &wfds);
|
||||||
|
#endif
|
||||||
|
|
||||||
r = select(handle->sock + 1, NULL, &wfds, NULL, &tv);
|
r = select(handle->sock + 1, NULL, &wfds, NULL, &tv);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user