51 yassert(
bool exp,
const char* expstr,
const char* message,
52 int line,
const char* file)
57 "%s\nMessage: \n%s\nAt line %i in file \"%s\".\n",
58 expstr, message, line, file);
74 static bool bSleepEnabled(
true);
75 const bool b_old(bSleepEnabled);
77 if(b != bSleepEnabled)
80 ::fifoSendValue32(FIFO_PM,
81 b ? PM_REQ_SLEEP_ENABLE : PM_REQ_SLEEP_DISABLE);
87 UTF8ToMBCS(
const char* str, std::size_t len,
int cp)
92 const int w_len(::MultiByteToWideChar(CP_UTF8, 0, str, len,
nullptr, 0));
93 std::wstring wstr(w_len,
wchar_t());
94 wchar_t* w_str = &wstr[0];
96 ::MultiByteToWideChar(CP_UTF8, 0, str, len, w_str, w_len);
98 return WCSToMBCS(w_str, w_len, cp);
102 WCSToMBCS(
const wchar_t* str, std::size_t len,
int cp)
104 const int r_len(::WideCharToMultiByte(cp, 0, str, len,
105 nullptr, 0,
nullptr,
nullptr));
108 ::WideCharToMultiByte(cp, 0, str, len, &mbcs[0], r_len,
nullptr,
nullptr);