]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
rtmp: stop redefining `setsockopt` system symbol on Windows
authorViktor Szakats <commit@vsz.me>
Sun, 30 Nov 2025 11:34:02 +0000 (12:34 +0100)
committerViktor Szakats <commit@vsz.me>
Sun, 30 Nov 2025 21:27:25 +0000 (22:27 +0100)
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

lib/curl_rtmp.c

index b2dd937008a584fff9a6b9d78054c6e450e0a7e2..6f9e7c37b4b882d3950658c89c5367ce72ae781a 100644 (file)
 #include <curl/curl.h>
 #include <librtmp/rtmp.h>
 
-#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}