3
0
Fork 0
forked from suyu/suyu

Merge branch 'fix-compile-ubuntu-22.04' into 'master'

Fix Linux compile

See merge request suyu2/suyu!9
This commit is contained in:
Crimson Hawk 2024-03-05 22:25:39 +00:00
commit 978297fc81
3 changed files with 14 additions and 4 deletions

View file

@ -12,8 +12,10 @@ namespace Service {
// clang-format off
template <typename T>
struct AutoOut {
T raw;
class AutoOut {
public:
T raw;
AutoOut() : raw() {}
};
template <typename T>

View file

@ -401,6 +401,10 @@ static_assert(sizeof(AccountNotificationSettings) == 0x18,
/// This is nn::settings::factory::BatteryLot
struct BatteryLot {
std::array<char, 0x18> lot_number;
BatteryLot() = default;
BatteryLot(const char* str) {
std::copy(str, str + std::min(sizeof(lot_number), strlen(str)), lot_number.begin());
}
};
static_assert(sizeof(BatteryLot) == 0x18, "BatteryLot is an invalid size");
@ -477,6 +481,10 @@ static_assert(sizeof(NotificationSettings) == 0x18, "NotificationSettings is an
/// This is nn::settings::factory::SerialNumber
struct SerialNumber {
std::array<char, 0x18> serial_number;
SerialNumber() = default;
SerialNumber(const char* str) {
std::copy(str, str + std::min(sizeof(serial_number), strlen(str)), serial_number.begin());
}
};
static_assert(sizeof(SerialNumber) == 0x18, "SerialNumber is an invalid size");

View file

@ -932,14 +932,14 @@ Result ISystemSettingsServer::SetPrimaryAlbumStorage(PrimaryAlbumStorage primary
Result ISystemSettingsServer::GetBatteryLot(Out<BatteryLot> out_battery_lot) {
LOG_INFO(Service_SET, "called");
*out_battery_lot = {"YUZU0EMULATOR14022024"};
*out_battery_lot = BatteryLot("YUZU0EMULATOR14022024");
R_SUCCEED();
}
Result ISystemSettingsServer::GetSerialNumber(Out<SerialNumber> out_console_serial) {
LOG_INFO(Service_SET, "called");
*out_console_serial = {"YUZ10000000001"};
*out_console_serial = SerialNumber("YUZ10000000001");
R_SUCCEED();
}