mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-01 15:28:21 -04:00
constexpr: resign ourselves to gcc dropping void -> T support
This commit is contained in:
parent
96d3187f3e
commit
ad4c794aea
16 changed files with 201 additions and 290 deletions
|
@ -30,7 +30,7 @@ namespace ams::os::impl {
|
|||
static constexpr s32 WaitInvalid = -3;
|
||||
static constexpr s32 WaitCancelled = -2;
|
||||
static constexpr s32 WaitTimedOut = -1;
|
||||
using MultiWaitList = util::IntrusiveListMemberTraits<&MultiWaitHolderBase::m_multi_wait_node>::ListType;
|
||||
using MultiWaitList = util::IntrusiveListMemberTraitsByNonConstexprOffsetOf<&MultiWaitHolderBase::m_multi_wait_node>::ListType;
|
||||
private:
|
||||
MultiWaitList m_multi_wait_list;
|
||||
MultiWaitHolderBase *m_signaled_holder;
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace ams::os::impl {
|
|||
|
||||
class MultiWaitObjectList {
|
||||
public:
|
||||
using ListType = util::IntrusiveListMemberTraits<&MultiWaitHolderBase::m_object_list_node>::ListType;
|
||||
using ListType = util::IntrusiveListMemberTraitsByNonConstexprOffsetOf<&MultiWaitHolderBase::m_object_list_node>::ListType;
|
||||
private:
|
||||
ListType m_object_list;
|
||||
public:
|
||||
|
|
|
@ -34,20 +34,22 @@ namespace ams::os::impl {
|
|||
private:
|
||||
friend class util::IntrusiveList<ThreadType, ThreadListTraits>;
|
||||
|
||||
static constexpr util::IntrusiveListNode &GetNode(ThreadType &parent) {
|
||||
static util::IntrusiveListNode &GetNode(ThreadType &parent) {
|
||||
return GetReference(parent.all_threads_node);
|
||||
}
|
||||
|
||||
static constexpr util::IntrusiveListNode const &GetNode(ThreadType const &parent) {
|
||||
static util::IntrusiveListNode const &GetNode(ThreadType const &parent) {
|
||||
return GetReference(parent.all_threads_node);
|
||||
}
|
||||
|
||||
static constexpr size_t Offset = OFFSETOF(ThreadType, all_threads_node);
|
||||
|
||||
static ThreadType &GetParent(util::IntrusiveListNode &node) {
|
||||
return *reinterpret_cast<ThreadType *>(reinterpret_cast<char *>(std::addressof(node)) - OFFSETOF(ThreadType, all_threads_node));
|
||||
return *reinterpret_cast<ThreadType *>(reinterpret_cast<char *>(std::addressof(node)) - Offset);
|
||||
}
|
||||
|
||||
static ThreadType const &GetParent(util::IntrusiveListNode const &node) {
|
||||
return *reinterpret_cast<const ThreadType *>(reinterpret_cast<const char *>(std::addressof(node)) - OFFSETOF(ThreadType, all_threads_node));
|
||||
return *reinterpret_cast<const ThreadType *>(reinterpret_cast<const char *>(std::addressof(node)) - Offset);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue