You need to sign in or sign up before continuing.
Commit 8c4246f2 authored by Max Kellermann's avatar Max Kellermann

net/SocketError: remove obsolete Error functions

parent 54d51842
......@@ -19,13 +19,10 @@
#include "config.h"
#include "SocketError.hxx"
#include "util/Domain.hxx"
#include "util/Macros.hxx"
#include <string.h>
const Domain socket_domain("socket");
#ifdef WIN32
SocketErrorMessage::SocketErrorMessage(socket_error_t code)
......
......@@ -22,7 +22,6 @@
#include "Compiler.h"
#include "system/Error.hxx"
#include "util/Error.hxx" // IWYU pragma: export
#ifdef WIN32
#include <winsock2.h>
......@@ -32,14 +31,6 @@ typedef DWORD socket_error_t;
typedef int socket_error_t;
#endif
class Domain;
/**
* A #Domain for #Error for socket I/O errors. The code is an errno
* value (or WSAGetLastError() on Windows).
*/
extern const Domain socket_domain;
gcc_pure
static inline socket_error_t
GetSocketError()
......@@ -108,35 +99,6 @@ public:
}
};
static inline void
SetSocketError(Error &error, socket_error_t code)
{
const SocketErrorMessage msg(code);
error.Set(socket_domain, code, msg);
}
static inline void
SetSocketError(Error &error)
{
SetSocketError(error, GetSocketError());
}
gcc_const
static inline Error
NewSocketError(socket_error_t code)
{
Error error;
SetSocketError(error, code);
return error;
}
gcc_pure
static inline Error
NewSocketError()
{
return NewSocketError(GetSocketError());
}
gcc_const
static inline std::system_error
MakeSocketError(socket_error_t code, const char *msg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment