mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 14:01:17 +12:00
Proper fix for static asserts (#64)
Replace std::uniform_int_distribution with boost::random::uniform_int_distribution
This commit is contained in:
parent
19a0a3a359
commit
1cb2d4e5ee
5 changed files with 20 additions and 13 deletions
|
@ -3,12 +3,13 @@
|
|||
#include "gui/CemuApp.h"
|
||||
#include "util/helpers/SystemException.h"
|
||||
|
||||
#include <random>
|
||||
|
||||
#include "config/ActiveSettings.h"
|
||||
#include "Cafe/IOSU/legacy/iosu_crypto.h"
|
||||
#include "Common/filestream.h"
|
||||
|
||||
#include <random>
|
||||
#include <boost/random/uniform_int.hpp>
|
||||
|
||||
std::vector<Account> Account::s_account_list;
|
||||
|
||||
Account::Account(uint32 persistent_id)
|
||||
|
@ -65,8 +66,11 @@ Account::Account(uint32 persistent_id, std::wstring_view mii_name)
|
|||
|
||||
static std::random_device s_random_device;
|
||||
static std::mt19937 s_mte(s_random_device());
|
||||
std::uniform_int_distribution<uint16> dist(std::numeric_limits<uint8>::min(), std::numeric_limits<uint8>::max());
|
||||
std::generate(m_uuid.begin(), m_uuid.end(), [&]() { return (uint8)dist(s_mte); });
|
||||
|
||||
// use boost library to escape static asserts in linux builds
|
||||
boost::random::uniform_int_distribution<uint16> dist(std::numeric_limits<uint8>::min(), std::numeric_limits<uint8>::max());
|
||||
|
||||
std::generate(m_uuid.begin(), m_uuid.end(), [&]() { return (uint8)dist(s_mte); });
|
||||
|
||||
// 1000004 or 2000004 | lower uint32 from uuid from uuid
|
||||
m_transferable_id_base = (0x2000004ULL << 32);
|
||||
|
@ -575,4 +579,4 @@ void actPwTest()
|
|||
makePWHash(pwHash, 32, pid, pwHash); // calculates AccountPasswordHash
|
||||
|
||||
assert_dbg();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue