From: Viktor Szakats Date: Sun, 30 Nov 2025 11:34:02 +0000 (+0100) Subject: rtmp: stop redefining `setsockopt` system symbol on Windows X-Git-Tag: rc-8_18_0-1~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdf9937cef62755f67e7d622d6fdd296eb542009;p=thirdparty%2Fcurl.git rtmp: stop redefining `setsockopt` system symbol on Windows Before this patch it added Windows-specific casts. In unity builds this also affected other source files. `setsockopt()` is called without special casts in other places in the code, and passing a non-const char ptr to a const char ptr arg also should work. Basic compile test with mingw-w64 confirms. In case of issues, a cast to `curl_socklen_t` can be used, or do the special case in an `#if` branch. Also: merge Windows-specific guards for `SET_RCVTIMEO()`. Follow-up to 639d052e4499c663a578d940713e40cd466268fa #3155 Follow-up to 04cb15ae9dc0e863487ee55de2226cf5033311c0 Closes #19768 --- diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index b2dd937008..6f9e7c37b4 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -37,10 +37,7 @@ #include #include -#if defined(_WIN32) && !defined(USE_LWIPSOCK) -#define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e) -#define SET_RCVTIMEO(tv,s) int tv = s*1000 -#elif defined(LWIP_SO_SNDRCVTIMEO_NONSTANDARD) +#if defined(USE_WINSOCK) || defined(LWIP_SO_SNDRCVTIMEO_NONSTANDARD) #define SET_RCVTIMEO(tv,s) int tv = s*1000 #else #define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0}