Ticket #6516: 6516-fix-windows-compilation-after-r21591.2.patch

File 6516-fix-windows-compilation-after-r21591.2.patch, 1.1 KB (added by Jonathan Martens <jonathan@…>, 11 years ago)

Updated version of previous patch that also reorders variable initialisation to prevent two compiler warnings about unused variables as seen in comment 10.

  • libs/libmythdb/mythsocketthread.cpp

     
    33#include <cassert>
    44
    55// POSIX
     6#ifdef USING_MINGW
     7#include <winsock2.h>   // for select
     8#else
    69#include <sys/select.h> // for select
     10#endif
    711#include <sys/types.h>  // for fnctl
    812#include <unistd.h>     // for fnctl & other
    913#include <fcntl.h>      // for fnctl
    1014#include <errno.h>      // for checking errno
    1115
    12 // Microsoft
    13 #ifdef USING_MINGW
    14 #include <winsock2.h>
    15 #endif
    16 
    1716// MythTV
    1817#include "mythsocketthread.h"
    1918#include "mythsocket.h"
     
    157156{
    158157    VERBOSE(VB_SOCKET, "MythSocketThread: readyread thread start");
    159158
    160     fd_set rfds;
    161159    MythSocket *sock;
    162     int maxfd;
    163160    bool found;
    164161
    165162    while (m_readyread_run)
     
    273270
    274271#else /* if !USING_MINGW */
    275272
     273        fd_set rfds;
     274        int maxfd;
     275
    276276        // add check for bad fd?
    277277        FD_ZERO(&rfds);
    278278        maxfd = m_readyread_pipe[0];