Merge branch 'v0.20.x'
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TCP
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_TCP
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
|
@@ -35,7 +35,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
@@ -46,7 +46,7 @@
|
||||
*/
|
||||
class SocketAddress {
|
||||
public:
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
typedef int size_type;
|
||||
#else
|
||||
typedef socklen_t size_type;
|
||||
|
@@ -108,7 +108,7 @@ SocketDescriptor::Connect(SocketAddress address)
|
||||
bool
|
||||
SocketDescriptor::Create(int domain, int type, int protocol)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
static bool initialised = false;
|
||||
if (!initialised) {
|
||||
WSADATA data;
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
|
||||
SocketErrorMessage::SocketErrorMessage(socket_error_t code) noexcept
|
||||
{
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include "Compiler.h"
|
||||
#include "system/Error.hxx"
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
typedef DWORD socket_error_t;
|
||||
#else
|
||||
@@ -35,7 +35,7 @@ gcc_pure
|
||||
static inline socket_error_t
|
||||
GetSocketError() noexcept
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
return WSAGetLastError();
|
||||
#else
|
||||
return errno;
|
||||
@@ -46,7 +46,7 @@ gcc_const
|
||||
static inline bool
|
||||
IsSocketErrorAgain(socket_error_t code) noexcept
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
return code == WSAEINPROGRESS;
|
||||
#else
|
||||
return code == EAGAIN;
|
||||
@@ -57,7 +57,7 @@ gcc_const
|
||||
static inline bool
|
||||
IsSocketErrorInterruped(socket_error_t code) noexcept
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
return code == WSAEINTR;
|
||||
#else
|
||||
return code == EINTR;
|
||||
@@ -68,7 +68,7 @@ gcc_const
|
||||
static inline bool
|
||||
IsSocketErrorClosed(socket_error_t code) noexcept
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
return code == WSAECONNRESET;
|
||||
#else
|
||||
return code == EPIPE || code == ECONNRESET;
|
||||
@@ -81,7 +81,7 @@ IsSocketErrorClosed(socket_error_t code) noexcept
|
||||
* and this class hosts the buffer.
|
||||
*/
|
||||
class SocketErrorMessage {
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
char msg[256];
|
||||
#else
|
||||
const char *const msg;
|
||||
@@ -99,7 +99,7 @@ gcc_const
|
||||
static inline std::system_error
|
||||
MakeSocketError(socket_error_t code, const char *msg) noexcept
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
return MakeLastError(code, msg);
|
||||
#else
|
||||
return MakeErrno(code, msg);
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_TCP
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
|
@@ -34,7 +34,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <netdb.h>
|
||||
|
Reference in New Issue
Block a user