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 639d052e44 #3155
Follow-up to 04cb15ae9d

Closes #19768
This commit is contained in:
Viktor Szakats 2025-11-30 12:34:02 +01:00
parent 0180af2481
commit fdf9937cef
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -37,10 +37,7 @@
#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}