mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 13:01:27 +12:00
Implement std::bit_cast<>
Partial implementation of std::bit_cast from C++20. Also fix most strict-aliasing rule break warnings (gcc).
This commit is contained in:
parent
790962425c
commit
dfd50d0185
24 changed files with 145 additions and 176 deletions
|
@ -68,13 +68,13 @@ public:
|
|||
// Get current "push" position
|
||||
u32 size() const
|
||||
{
|
||||
return reinterpret_cast<const atomic_t<u32>&>(m_ctrl).load(); // Hack
|
||||
return m_ctrl.load().push;
|
||||
}
|
||||
|
||||
// Acquire the place for one or more elements.
|
||||
u32 push_begin(u32 count = 1)
|
||||
{
|
||||
return reinterpret_cast<atomic_t<u32>&>(m_ctrl).fetch_add(count); // Hack
|
||||
return std::bit_cast<atomic_t<u64>*>(&m_ctrl)->fetch_add(count); // Hack
|
||||
}
|
||||
|
||||
// Get current "pop" position
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue