mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +00:00
named_thread: fix bugs in std::forward usage
Fix few misused threads and other bugs.
This commit is contained in:
parent
d788b12a8e
commit
bbf52f3cea
5 changed files with 111 additions and 211 deletions
|
|
@ -10,6 +10,7 @@ namespace stx
|
|||
#pragma GCC diagnostic push
|
||||
#ifdef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wundefined-var-template"
|
||||
#pragma GCC diagnostic ignored "-Wundefined-internal"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
@ -21,7 +22,7 @@ namespace stx
|
|||
template <typename T, typename U>
|
||||
constexpr bool is_same_ptr() noexcept
|
||||
{
|
||||
#if !defined(_MSC_VER) && !defined(__clang__)
|
||||
#ifdef _MSC_VER
|
||||
return true;
|
||||
#else
|
||||
if constexpr (std::is_void_v<T> || std::is_void_v<U> || std::is_same_v<T, U>)
|
||||
|
|
@ -30,14 +31,14 @@ namespace stx
|
|||
}
|
||||
else if constexpr (std::is_convertible_v<U*, T*>)
|
||||
{
|
||||
const auto u = std::addressof(sample<U>);
|
||||
const volatile void* x = u;
|
||||
constexpr auto u = std::addressof(sample<U>);
|
||||
constexpr volatile void* x = u;
|
||||
return static_cast<T*>(u) == x;
|
||||
}
|
||||
else if constexpr (std::is_convertible_v<T*, U*>)
|
||||
{
|
||||
const auto t = std::addressof(sample<T>);
|
||||
const volatile void* x = t;
|
||||
constexpr auto t = std::addressof(sample<T>);
|
||||
constexpr volatile void* x = t;
|
||||
return static_cast<U*>(t) == x;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue