]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix windows build
authorJeff Lenk <jeff@jefflenk.com>
Tue, 20 Jul 2010 20:31:45 +0000 (15:31 -0500)
committerJeff Lenk <jeff@jefflenk.com>
Tue, 20 Jul 2010 20:33:48 +0000 (15:33 -0500)
libs/esl/src/esl.c

index c63f2b1a00499d5b10fdda4d591f6e8a9d28a5d1..979c21696fbff27860ecc96eb464583f924c5b27 100644 (file)
@@ -613,8 +613,9 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
        int rval = 0;
        const char *hval;
        struct addrinfo hints = { 0 }, *result;
+#ifndef WIN32
        int fd_flags;
-#ifdef WIN32
+#else
        WORD wVersionRequested = MAKEWORD(2, 0);
        WSADATA 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) {
                fd_set wfds;
-               struct timeval tv = { timeout / 1000, (timeout % 1000) * 1000 };
+               struct timeval tv;
                int r;
 
+               tv.tv_sec = timeout / 1000;
+               tv.tv_usec = (timeout % 1000) * 1000;
                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);
+#endif
 
         r = select(handle->sock + 1, NULL, &wfds, NULL, &tv);