From edc4b07532032ee90152da25c2d653a184f17afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Sat, 19 Feb 2022 17:42:41 -0500 Subject: [PATCH] Make socket_send_buffer_t separate from socket_recv_buffer_t It seems we can't add a const to a typedef in a static_cast<>() --- src/xpdev/sockwrap.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xpdev/sockwrap.h b/src/xpdev/sockwrap.h index a2402baa90..fcfc63f66b 100644 --- a/src/xpdev/sockwrap.h +++ b/src/xpdev/sockwrap.h @@ -28,7 +28,8 @@ /* OS-specific */ /***************/ #if defined(_WIN32) /* Use WinSock */ -typedef char* socket_buffer_t; +typedef const char* socket_send_buffer_t; +typedef char* socket_recv_buffer_t; #ifndef _WINSOCKAPI_ #include <winsock2.h> /* socket/bind/etc. */ @@ -51,7 +52,8 @@ typedef char* socket_buffer_t; #endif #elif defined __unix__ /* Unix-variant */ -typedef void* socket_buffer_t; +typedef const void* socket_send_buffer_t; +typedef void* socket_recv_buffer_t; #include <netdb.h> /* gethostbyname */ #include <sys/types.h> /* For u_int32_t on FreeBSD */ -- GitLab