socket: explain and relax type casting requirement
The recv/send functions (and the assertions) were only tested under 32bit systems. They need relaxing for 64bit.
This commit is contained in:
parent
b8ba95f365
commit
976a4b7330
@ -52,8 +52,12 @@ socket_domain<D>::socket_domain (socket_t _fd):
|
||||
// TODO: Make this not retarded. Fucking Windows.
|
||||
#define dup(X) (X)
|
||||
|
||||
static_assert(sizeof(int) == sizeof(ssize_t), "int != ssize_t");
|
||||
static_assert(sizeof(int) == sizeof( size_t), "int != size_t");
|
||||
// Winsock has incorrect return and parameter types (according to POSIX)
|
||||
// so we need some wrappers around the system implementations that casts
|
||||
// to expected types. Mainly int vs ssize_t returns, and int vs size_t
|
||||
// parameters.
|
||||
static_assert(sizeof(int) <= sizeof(ssize_t), "int != ssize_t");
|
||||
static_assert(sizeof(int) <= sizeof( size_t), "int != size_t");
|
||||
|
||||
ssize_t recv(socket_t _socket, void *_buf, size_t _len, int _flags)
|
||||
{ return (ssize_t)::recv(_socket, (char*)_buf, (int)_len, _flags); }
|
||||
|
Loading…
Reference in New Issue
Block a user