net: remove unnecessary casts in socket operations

These methods in the Sock class wrap corresponding syscalls,
accepting void* arguments and casting to char* internally, which is
needed for Windows support and ignored on other platforms because
the syscall itself accepts void*:

Send()
Recv()
GetSockOpt()
SetSockOpt()
This commit is contained in:
Matthew Zipkin
2025-09-12 12:38:01 -04:00
parent d20f10affb
commit 67f632b6de
5 changed files with 8 additions and 16 deletions

View File

@@ -75,14 +75,6 @@ typedef unsigned int SOCKET;
typedef SSIZE_T ssize_t;
#endif
// The type of the option value passed to getsockopt & setsockopt
// differs between Windows and non-Windows.
#ifndef WIN32
typedef void* sockopt_arg_type;
#else
typedef char* sockopt_arg_type;
#endif
#ifdef WIN32
// Export main() and ensure working ASLR when using mingw-w64.
// Exporting a symbol will prevent the linker from stripping