Use platform-specific checks for invalid descriptors
Check network fd/socket validity using INVALID_SOCKET on Windows (requiring conditional winsock2.h include) and < 0 otherwise. Fixes -Wsign-compare warning.
This commit is contained in:
parent
6a302d0602
commit
c048a21aa4
|
@ -62,6 +62,9 @@
|
||||||
#include "../verbosity.h"
|
#include "../verbosity.h"
|
||||||
|
|
||||||
#include "../ai/game_ai.h"
|
#include "../ai/game_ai.h"
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#include <winsock2.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define HOLD_BTN_DELAY_SEC 2
|
#define HOLD_BTN_DELAY_SEC 2
|
||||||
|
|
||||||
|
@ -6776,7 +6779,12 @@ void input_driver_poll(void)
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
struct remote_message msg;
|
struct remote_message msg;
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
if (input_st->remote->net_fd[user] == INVALID_SOCKET)
|
||||||
|
#else
|
||||||
if (input_st->remote->net_fd[user] < 0)
|
if (input_st->remote->net_fd[user] < 0)
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FD_ZERO(&fds);
|
FD_ZERO(&fds);
|
||||||
|
|
Loading…
Reference in New Issue