early-access version 2853
This commit is contained in:
13
externals/vcpkg/ports/coroutine/add-noexcept-to-frame.patch
vendored
Executable file
13
externals/vcpkg/ports/coroutine/add-noexcept-to-frame.patch
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
--- a/interface/coroutine/frame.h
|
||||
+++ a/interface/coroutine/frame.h
|
||||
@@ -119,8 +119,8 @@
|
||||
return *this;
|
||||
}
|
||||
// 17.12.3.2, export/import
|
||||
- static /*constexpr*/ coroutine_handle from_address(void* _Addr) {
|
||||
+ static /*constexpr*/ coroutine_handle from_address(void* _Addr) noexcept {
|
||||
coroutine_handle _Result{};
|
||||
_Result._Ptr = reinterpret_cast<portable_coro_prefix*>(_Addr);
|
||||
return _Result;
|
||||
}
|
||||
|
68
externals/vcpkg/ports/coroutine/fix-errorC7651.patch
vendored
Executable file
68
externals/vcpkg/ports/coroutine/fix-errorC7651.patch
vendored
Executable file
@@ -0,0 +1,68 @@
|
||||
diff --git a/modules/portable/frame.cpp b/modules/portable/frame.cpp
|
||||
index 2cedf81..f413f28 100644
|
||||
--- a/modules/portable/frame.cpp
|
||||
+++ b/modules/portable/frame.cpp
|
||||
@@ -77,13 +77,31 @@ size_t _coro_done(void*);
|
||||
//
|
||||
// intrinsic: Clang/GCC
|
||||
//
|
||||
-extern "C" {
|
||||
-bool __builtin_coro_done(void*);
|
||||
-void __builtin_coro_resume(void*);
|
||||
-void __builtin_coro_destroy(void*);
|
||||
-// void* __builtin_coro_promise(void* ptr, int align, bool p);
|
||||
+//extern "C" {
|
||||
+template <bool B>
|
||||
+void resume_wrapper(void *p)
|
||||
+{
|
||||
+ if constexpr (B)
|
||||
+ __builtin_coro_resume(p);
|
||||
+}
|
||||
+
|
||||
+template <bool B>
|
||||
+void destroy_wrapper(void *p)
|
||||
+{
|
||||
+ if constexpr(B)
|
||||
+ __builtin_coro_destroy(p);
|
||||
}
|
||||
|
||||
+template <bool B>
|
||||
+bool done_wrapper(void *p)
|
||||
+{
|
||||
+ if constexpr(B)
|
||||
+ return __builtin_coro_done(p);
|
||||
+ return false;
|
||||
+}
|
||||
+// void* __builtin_coro_promise(void* ptr, int align, bool p);
|
||||
+//}
|
||||
+
|
||||
bool _coro_finished(portable_coro_prefix* _Handle);
|
||||
|
||||
#if defined(__clang__)
|
||||
@@ -124,7 +142,7 @@ bool portable_coro_done(portable_coro_prefix* _Handle) {
|
||||
if constexpr (is_msvc) {
|
||||
return _coro_finished(_Handle);
|
||||
} else if constexpr (is_clang) {
|
||||
- return __builtin_coro_done(_Handle);
|
||||
+ return done_wrapper<true>(_Handle);
|
||||
}
|
||||
return false; // follow `noop_coroutine`
|
||||
}
|
||||
@@ -133,7 +151,7 @@ void portable_coro_resume(portable_coro_prefix* _Handle) {
|
||||
if constexpr (is_msvc) {
|
||||
_coro_resume(_Handle);
|
||||
} else if constexpr (is_clang) {
|
||||
- __builtin_coro_resume(_Handle);
|
||||
+ resume_wrapper<true>(_Handle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +159,7 @@ void portable_coro_destroy(portable_coro_prefix* _Handle) {
|
||||
if constexpr (is_msvc) {
|
||||
_coro_destroy(_Handle);
|
||||
} else if constexpr (is_clang) {
|
||||
- __builtin_coro_destroy(_Handle);
|
||||
+ destroy_wrapper<true>(_Handle);
|
||||
}
|
||||
}
|
||||
|
80
externals/vcpkg/ports/coroutine/gsl-4_0_0.patch
vendored
Executable file
80
externals/vcpkg/ports/coroutine/gsl-4_0_0.patch
vendored
Executable file
@@ -0,0 +1,80 @@
|
||||
diff --git a/interface/coroutine/net.h b/interface/coroutine/net.h
|
||||
index 17b70a8..3c44827 100644
|
||||
--- a/interface/coroutine/net.h
|
||||
+++ b/interface/coroutine/net.h
|
||||
@@ -344,7 +344,7 @@ void poll_net_tasks(uint64_t nano) noexcept(false);
|
||||
* @ingroup Network
|
||||
*/
|
||||
uint32_t get_address(const addrinfo& hint, //
|
||||
- gsl::czstring<> host, gsl::czstring<> serv,
|
||||
+ gsl::czstring host, gsl::czstring serv,
|
||||
gsl::span<sockaddr_in> output) noexcept;
|
||||
|
||||
/**
|
||||
@@ -361,7 +361,7 @@ uint32_t get_address(const addrinfo& hint, //
|
||||
* @ingroup Network
|
||||
*/
|
||||
uint32_t get_address(const addrinfo& hint, //
|
||||
- gsl::czstring<> host, gsl::czstring<> serv,
|
||||
+ gsl::czstring host, gsl::czstring serv,
|
||||
gsl::span<sockaddr_in6> output) noexcept;
|
||||
|
||||
/**
|
||||
@@ -377,7 +377,7 @@ uint32_t get_address(const addrinfo& hint, //
|
||||
* @ingroup Network
|
||||
*/
|
||||
uint32_t get_name(const sockaddr_in& addr, //
|
||||
- gsl::zstring<NI_MAXHOST> name, gsl::zstring<NI_MAXSERV> serv,
|
||||
+ gsl::basic_zstring<char, NI_MAXHOST> name, gsl::basic_zstring<char, NI_MAXSERV> serv,
|
||||
int32_t flags = NI_NUMERICHOST | NI_NUMERICSERV) noexcept;
|
||||
|
||||
/**
|
||||
@@ -392,7 +392,7 @@ uint32_t get_name(const sockaddr_in& addr, //
|
||||
* @ingroup Network
|
||||
*/
|
||||
uint32_t get_name(const sockaddr_in6& addr, //
|
||||
- gsl::zstring<NI_MAXHOST> name, gsl::zstring<NI_MAXSERV> serv,
|
||||
+ gsl::basic_zstring<char, NI_MAXHOST> name, gsl::basic_zstring<char, NI_MAXSERV> serv,
|
||||
int32_t flags = NI_NUMERICHOST | NI_NUMERICSERV) noexcept;
|
||||
|
||||
} // namespace coro
|
||||
diff --git a/modules/net/resolver.cpp b/modules/net/resolver.cpp
|
||||
index 21a9800..5328939 100644
|
||||
--- a/modules/net/resolver.cpp
|
||||
+++ b/modules/net/resolver.cpp
|
||||
@@ -9,7 +9,7 @@ namespace coro {
|
||||
|
||||
GSL_SUPPRESS(type .1)
|
||||
uint32_t get_name(const sockaddr_in& addr, //
|
||||
- gsl::zstring<NI_MAXHOST> name, gsl::zstring<NI_MAXSERV> serv,
|
||||
+ gsl::basic_zstring<char, NI_MAXHOST> name, gsl::basic_zstring<char, NI_MAXSERV> serv,
|
||||
int32_t flags) noexcept {
|
||||
const auto* ptr = reinterpret_cast<const sockaddr*>(addressof(addr));
|
||||
return ::getnameinfo(ptr, sizeof(sockaddr_in), //
|
||||
@@ -20,7 +20,7 @@ uint32_t get_name(const sockaddr_in& addr, //
|
||||
|
||||
GSL_SUPPRESS(type .1)
|
||||
uint32_t get_name(const sockaddr_in6& addr, //
|
||||
- gsl::zstring<NI_MAXHOST> name, gsl::zstring<NI_MAXSERV> serv,
|
||||
+ gsl::basic_zstring<char, NI_MAXHOST> name, gsl::basic_zstring<char, NI_MAXSERV> serv,
|
||||
int32_t flags) noexcept {
|
||||
const auto* ptr = reinterpret_cast<const sockaddr*>(addressof(addr));
|
||||
return ::getnameinfo(ptr, sizeof(sockaddr_in6), //
|
||||
@@ -58,7 +58,7 @@ auto get_address(addrinfo* list, sockaddr_in6 addr) noexcept
|
||||
}
|
||||
|
||||
uint32_t get_address(const addrinfo& hint, //
|
||||
- gsl::czstring<> host, gsl::czstring<> serv,
|
||||
+ gsl::czstring host, gsl::czstring serv,
|
||||
gsl::span<sockaddr_in> output) noexcept {
|
||||
addrinfo* list = nullptr;
|
||||
if (const auto ec = ::getaddrinfo(host, serv, //
|
||||
@@ -74,7 +74,7 @@ uint32_t get_address(const addrinfo& hint, //
|
||||
}
|
||||
|
||||
uint32_t get_address(const addrinfo& hint, //
|
||||
- gsl::czstring<> host, gsl::czstring<> serv,
|
||||
+ gsl::czstring host, gsl::czstring serv,
|
||||
gsl::span<sockaddr_in6> output) noexcept {
|
||||
addrinfo* list = nullptr;
|
||||
if (const auto ec = ::getaddrinfo(host, serv, //
|
33
externals/vcpkg/ports/coroutine/portfile.cmake
vendored
Executable file
33
externals/vcpkg/ports/coroutine/portfile.cmake
vendored
Executable file
@@ -0,0 +1,33 @@
|
||||
if(VCPKG_TARGET_IS_LINUX)
|
||||
message("Warning: `coroutine` requires libc++ and Clang or GCC 10+ on Linux")
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO luncliff/coroutine
|
||||
REF 1.5.0
|
||||
SHA512 61b91fdc641b6905b884e99c5bf193ec2cf6962144ab3baafdb9432115757d96f3797f116b30356f0d21417b23082bc908f75042721caeab3329c4910b654594
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-errorC7651.patch
|
||||
add-noexcept-to-frame.patch
|
||||
gsl-4_0_0.patch
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DGSL_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include
|
||||
-DBUILD_TESTING=False
|
||||
)
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets()
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
|
||||
RENAME copyright
|
||||
)
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
11
externals/vcpkg/ports/coroutine/vcpkg.json
vendored
Executable file
11
externals/vcpkg/ports/coroutine/vcpkg.json
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "coroutine",
|
||||
"version": "1.5.0",
|
||||
"port-version": 4,
|
||||
"description": "C++ 20 Coroutines helper/example library",
|
||||
"homepage": "https://github.com/luncliff/coroutine",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
"ms-gsl"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user