diff --git a/net/pichi/files/patch-include_pichi_common_config.hpp.in b/net/pichi/files/patch-include_pichi_common_config.hpp.in new file mode 100644 index 000000000000..fcc42ad57a0e --- /dev/null +++ b/net/pichi/files/patch-include_pichi_common_config.hpp.in @@ -0,0 +1,79 @@ +--- include/pichi/common/config.hpp.in.orig ++++ include/pichi/common/config.hpp.in +@@ -15,48 +15,39 @@ + #cmakedefine HAS_SETSID + #cmakedefine HAS_CLOSE + +-#cmakedefine NO_IGNORED_ATTRIBUTES_FOR_SODIUM +-#cmakedefine DEPRECATED_RFC2818_CLASS ++#ifdef __GNUC__ + +-#cmakedefine DISABLE_SHORTEN_64_TO_32_WARNING +-#if defined(DISABLE_SHORTEN_64_TO_32_WARNING) && defined(__clang__) +-#pragma clang diagnostic push +-#pragma clang diagnostic ignored "-Wshorten-64-to-32" +-#include +-#include +-#include +-#pragma clang diagnostic pop +-#endif // DISABLE_SHORTEN_64_TO_32_WARNING && __clang__ ++#if __GNUC__ >= 8 ++#pragma GCC diagnostic ignored "-Wclass-memaccess" ++#endif // __GNUC__ >= 8 + +-#ifdef _MSC_VER +-#pragma warning(push) +-#pragma warning(disable : 4702) +-#include +-#pragma warning(pop) +-#endif // _MSC_VER ++#cmakedefine DISABLE_GCC_IGNORED_ATTRIBUTES ++#ifdef DISABLE_GCC_IGNORED_ATTRIBUTES ++#pragma GCC diagnostic ignored "-Wignored-attributes" ++#endif // DISABLE_GCC_IGNORED_ATTRIBUTES + +-#cmakedefine HAS_SP_COUNTED_BASE_CLANG_HPP +-#if defined(HAS_SP_COUNTED_BASE_CLANG_HPP) && defined(__clang__) +-#if !__has_feature(c_atomic) +-#pragma clang diagnostic push +-#pragma clang diagnostic ignored "-Wc11-extensions" +-#include +-#pragma clang diagnostic pop +-#endif // !__has_feature(c_atomic) +-#endif // HAS_SP_COUNTED_BASE_CLANG_HPP && __clang__ ++#endif // __GNUC__ + +-#cmakedefine DEPRECATED_ALLOCATOR_VOID +-#if defined(DEPRECATED_ALLOCATOR_VOID) && defined(__clang__) +-#pragma clang diagnostic push ++#ifdef __clang__ ++ ++#if (defined(__APPLE__) && __clang_major__ >= 12) || __clang_major__ >= 11 + #pragma clang diagnostic ignored "-Wdeprecated-declarations" +-#include +-#include +-#include +-#include +-#include +-#include +-#pragma clang diagnostic pop +-#endif // DEPRECATED_ALLOCATOR_VOID && __clang__ ++#endif ++ ++#cmakedefine DISABLE_CLANG_C11_EXTENTIONS ++#if !__has_feature(c_atomic) && defined(DISABLE_CLANG_C11_EXTENTIONS) ++#pragma clang diagnostic ignored "-Wc11-extensions" ++#endif // !__has_feature(c_atomic) && defined(DISABLE_CLANG_C11_EXTENTIONS) ++ ++#endif // __clang__ ++ ++#ifdef _MSC_VER ++ ++#pragma warning(disable : 4459) ++#pragma warning(disable : 4646) ++#pragma warning(disable : 4702) ++ ++#endif // _MSC_VER + + #cmakedefine CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" + diff --git a/net/pichi/files/patch-src_net_adapter.cpp b/net/pichi/files/patch-src_net_adapter.cpp new file mode 100644 index 000000000000..359dc4ee1bff --- /dev/null +++ b/net/pichi/files/patch-src_net_adapter.cpp @@ -0,0 +1,67 @@ +--- src/net/adapter.cpp.orig ++++ src/net/adapter.cpp +@@ -27,11 +27,12 @@ + #include + #include + +-#ifdef DEPRECATED_RFC2818_CLASS ++#include ++#if BOOST_VERSION >= 107300 + #include +-#else // DEPRECATED_RFC2818_CLASS ++#else // BOOST_VERSION >= 107300 + #include +-#endif // DEPRECATED_RFC2818_CLASS ++#endif // BOOST_VERSION >= 107300 + + using namespace std; + namespace asio = boost::asio; +@@ -67,11 +68,11 @@ static auto createTlsContext(vo::TlsEgressOption const + ctx.load_verify_file(*option.caFile_); + else { + ctx.set_default_verify_paths(); +-#ifdef DEPRECATED_RFC2818_CLASS ++#if BOOST_VERSION >= 107300 + ctx.set_verify_callback(ssl::host_name_verification{option.serverName_.value_or(serverName)}); +-#else // DEPRECATED_RFC2818_CLASS ++#else // BOOST_VERSION >= 107300 + ctx.set_verify_callback(ssl::rfc2818_verification{option.serverName_.value_or(serverName)}); +-#endif // DEPRECATED_RFC2818_CLASS ++#endif // BOOST_VERSION >= 107300 + } + return ctx; + } +@@ -95,16 +96,10 @@ unique_ptr makeShadowsocksIngress(Socket&& s, + psk = {container, + crypto::generateKey(option.method_, ConstBuffer{option.password_}, container)}; + switch (option.method_) { +-#if MBEDTLS_VERSION_MAJOR < 3 + case CryptoMethod::RC4_MD5: + return make_unique>(psk, forward(s)); + case CryptoMethod::BF_CFB: + return make_unique>(psk, forward(s)); +-#else // MBEDTLS_VERSION_MAJOR < 3 +- case CryptoMethod::RC4_MD5: +- case CryptoMethod::BF_CFB: +- fail(PichiError::SEMANTIC_ERROR, vo::msg::DEPRECATED_METHOD); +-#endif // MBEDTLS_VERSION_MAJOR < 3 + case CryptoMethod::AES_128_CTR: + return make_unique>(psk, forward(s)); + case CryptoMethod::AES_192_CTR: +@@ -158,16 +153,10 @@ static unique_ptr makeShadowsocksEgress(vo::Sh + auto psk = MutableBuffer{container, len}; + + switch (option.method_) { +-#if MBEDTLS_VERSION_MAJOR < 3 + case CryptoMethod::RC4_MD5: + return make_unique>(psk, io); + case CryptoMethod::BF_CFB: + return make_unique>(psk, io); +-#else // MBEDTLS_VERSION_MAJOR < 3 +- case CryptoMethod::RC4_MD5: +- case CryptoMethod::BF_CFB: +- fail(PichiError::SEMANTIC_ERROR, vo::msg::DEPRECATED_METHOD); +-#endif // MBEDTLS_VERSION_MAJOR < 3 + case CryptoMethod::AES_128_CTR: + return make_unique>(psk, io); + case CryptoMethod::AES_192_CTR: