diff options
| author | 2026-11-25 17:36:37 +0100 | |
|---|---|---|
| committer | 2026-11-25 17:36:37 +0100 | |
| commit | 9e277ffea2f43d95e1c39af5a181958547b88592 (patch) | |
| tree | ae7bc6d27d6267173e6f83737732f56697ccfb5b /tools/inetcat.c | |
| parent | 2b5bbb8966e240fa352ef0ec09bef84d0507c8ea (diff) | |
| download | libusbmuxd-9e277ffea2f43d95e1c39af5a181958547b88592.tar.gz libusbmuxd-9e277ffea2f43d95e1c39af5a181958547b88592.tar.bz2 | |
FD_SET compares the descriptor to a SOCKET (unsigned) on Windows,
which triggers -Wsign-compare for our int descriptors. Cast to SOCKET
there via a small FD_SET_FD helper.
Diffstat (limited to 'tools/inetcat.c')
| -rw-r--r-- | tools/inetcat.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/inetcat.c b/tools/inetcat.c index 906b5c9..2410011 100644 --- a/tools/inetcat.c +++ b/tools/inetcat.c @@ -50,6 +50,13 @@ #include <signal.h> #endif +/* avoid -Wsign-compare: FD_SET compares against SOCKET (unsigned) on Windows */ +#ifdef _WIN32 +#define FD_SET_FD(fd, set) FD_SET((SOCKET)(fd), (set)) +#else +#define FD_SET_FD(fd, set) FD_SET((fd), (set)) +#endif + #ifdef _MSC_VER #include <basetsd.h> typedef SSIZE_T ssize_t; @@ -258,7 +265,7 @@ int main(int argc, char **argv) fd_set fds; FD_ZERO(&fds); FD_SET(STDIN_FILENO, &fds); - FD_SET(devfd, &fds); + FD_SET_FD(devfd, &fds); int ret = 0; uint8_t buf[4096]; |
