SOCKET defined in winsock2.h is unsigned and invalid value is defined as INVALID_SOCKET. Check this explicity to avoid compiler warnings.
See: https://learn.microsoft.com/en-us/windows/win32/winsock/socket-data-type-2 Signed-off-by: Kacper Michajłow <kaspe...@gmail.com> --- libavformat/os_support.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/os_support.c b/libavformat/os_support.c index 4d6eb8a74c..17d77a01d5 100644 --- a/libavformat/os_support.c +++ b/libavformat/os_support.c @@ -244,13 +244,16 @@ int ff_poll(struct pollfd *fds, nfds_t numfds, int timeout) n = 0; for (i = 0; i < numfds; i++) { +#if !HAVE_WINSOCK2_H if (fds[i].fd < 0) continue; -#if !HAVE_WINSOCK2_H if (fds[i].fd >= FD_SETSIZE) { errno = EINVAL; return -1; } +#else + if (fds[i].fd == INVALID_SOCKET) + continue; #endif /* !HAVE_WINSOCK2_H */ if (fds[i].events & POLLIN) -- 2.50.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".