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:
pstef 2025-04-10 18:18:32 +00:00
parent 6a302d0602
commit c048a21aa4
1 changed files with 8 additions and 0 deletions

View File

@ -62,6 +62,9 @@
#include "../verbosity.h"
#include "../ai/game_ai.h"
#if defined(_WIN32)
#include <winsock2.h>
#endif
#define HOLD_BTN_DELAY_SEC 2
@ -6776,7 +6779,12 @@ void input_driver_poll(void)
ssize_t ret;
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)
#endif
return;
FD_ZERO(&fds);