mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-03 02:34:48 +12:00
Add workaround helper for bit_cast and missing #include <bit>
Allows compilation on native macOS build system.
This commit is contained in:
parent
d0ae5f0546
commit
e9b3b7c2a2
4 changed files with 9 additions and 2 deletions
include
|
@ -152,6 +152,12 @@ namespace Helpers {
|
|||
static constexpr inline u8 incBCDByte(u8 value) {
|
||||
return ((value & 0xf) == 0x9) ? value + 7 : value + 1;
|
||||
}
|
||||
// Use this helper for platforms that lack a working std::bit_cast implementation
|
||||
// TODO: Replace this with C++20 version if available
|
||||
template< class To, class From >
|
||||
constexpr To bit_cast( const From& from ) noexcept{
|
||||
return *reinterpret_cast<const To*>(&from);
|
||||
}
|
||||
};
|
||||
|
||||
// UDLs for memory size values
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue