From 36715d9b79f34824e126c2bc3aee2f1c1c16af46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 14 Apr 2019 09:41:38 +0300 Subject: [PATCH] win32: wrap {g,s}etsockopt() char * can alias anything, and Winsock relies on that. Unfortunately, the compiler still issues warnings. This works around that. --- include/vlc_network.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/vlc_network.h b/include/vlc_network.h index 7cc384587a..b4d5fabdd6 100644 --- a/include/vlc_network.h +++ b/include/vlc_network.h @@ -202,6 +202,22 @@ VLC_API int vlc_close(int); /** @} */ +#ifdef _WIN32 +static inline int vlc_getsockopt(int s, int level, int name, + void *val, socklen_t *len) +{ + return getsockopt(s, level, name, (char *)val, len); +} +#define getsockopt vlc_getsockopt + +static inline int vlc_setsockopt(int s, int level, int name, + const void *val, socklen_t len) +{ + return setsockopt(s, level, name, (const char *)val, len); +} +#define setsockopt vlc_setsockopt +#endif + /* Portable network names/addresses resolution layer */ #define NI_MAXNUMERICHOST 64