From 797367f195f8a7468dfeacc873cbc3c4acdb6902 Mon Sep 17 00:00:00 2001 From: Alvaro Date: Sun, 2 Feb 2025 22:52:01 +0100 Subject: [PATCH] LocalSocket on Windows available on recent compilers without explicit option --- src/Socket.cpp | 8 +++++++- src/TlsSocket.cpp | 6 +++--- src/util.cpp | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Socket.cpp b/src/Socket.cpp index 34c5fd2..a07e7b9 100644 --- a/src/Socket.cpp +++ b/src/Socket.cpp @@ -5,6 +5,12 @@ struct IUnknown; // Workaround for "combaseapi.h(229): error C2187: syntax error: 'identifier' was unexpected here" with /permissive- #include #include + +#ifdef __has_include +#if __has_include() && !defined(ASL_SOCKET_LOCAL) +#define ASL_SOCKET_LOCAL +#endif +#endif #ifdef ASL_SOCKET_LOCAL #include #endif @@ -415,7 +421,7 @@ Socket_::Socket_(int fd) Socket_::~Socket_() { - close(); + Socket_::close(); } bool Socket_::init(bool force) diff --git a/src/TlsSocket.cpp b/src/TlsSocket.cpp index c2f93ba..7af6c67 100644 --- a/src/TlsSocket.cpp +++ b/src/TlsSocket.cpp @@ -17,8 +17,8 @@ //#define TLS_DEBUG 3 #ifdef _WIN32 -#include -#include +#include // NOLINT +#include // NOLINT #else #include #include @@ -214,7 +214,7 @@ TlsSocket_::TlsSocket_() TlsSocket_::~TlsSocket_() { - close(); + TlsSocket_::close(); mbedtls_net_free(&_core->net); mbedtls_x509_crt_free(&_core->cacert); mbedtls_ssl_free(&_core->ssl); diff --git a/src/util.cpp b/src/util.cpp index e53ae74..ef850dd 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -126,7 +126,7 @@ void Random::seed(ULong s) _state[i] = s ^ (s << (i + 2)); for (int i = 0; i < 6; i++) - unsigned x = get(); + get(); } void Random::init(bool fast)