29 #ifdef YSL_ARM9_MAIN_CPP_
30 # error The main source file has already compiled. Try to make the macro \
31 YSL_ARM9_MAIN_CPP_ be defined iff. once in the project.
34 #define YSL_ARM9_MAIN_CPP_ YSL_MAIN_CPP_
37 # error The main source file has already compiled. Try to make the macro \
38 YSL_MAIN_CPP_ be defined iff. once in the project.
48 using namespace platform;
58 class Log :
private noncopyable
108 Error(
const string& s)
133 #ifdef YSL_USE_MEMORY_DEBUG
136 OnExit_DebugMemory_continue()
138 std::puts(
"Input to continue...");
145 template<std::
size_t _vN,
class _tContainer>
147 OnExit_DebugMemory_print(_tContainer& con,
const char* item_name)
151 std::fprintf(stderr,
"%i %s(s) detected:\n", con.size(), item_name);
153 typename _tContainer::size_type n(0);
155 for(
const auto& item : con)
162 OnExit_DebugMemory_continue();
165 OnExit_DebugMemory_continue();
175 using namespace platform;
179 std::puts(
"Normal exit;");
184 "duplicate memory deleting");
186 DebugMemory.PrintAll(stderr);
187 DebugMemory.PrintAll(fp);
188 DebugMemory.PrintAllDuplicate(stderr);
189 DebugMemory.PrintAllDuplicate(fp);
192 std::puts(
"Input to terminate...");
221 WinMain(HINSTANCE, HINSTANCE, LPSTR,
int)
228 using namespace YSLib;
240 using namespace YSLib::UI;
243 Label lblTitle({50, 20, 100, 22}), lblStatus({60, 80, 120, 22}),
244 lblDetails({30, 20, 160, 22});
248 dsk_dn += lblDetails;
255 lblStatus.Text = u
"Now loading...",
256 lblDetails.Text = u
"初始化中,请稍后……",
259 lblDetails.Background =
nullptr;
261 yunseq(dsk_up.Validate(), dsk_dn.Validate());
262 dsk_up.Update(), dsk_dn.Update();
264 for(
size_t i(0); i < 10; ++i)
276 Execute(app, make_shared<YReader::ShlExplorer>());
281 #ifdef YSL_USE_MEMORY_DEBUG
282 OnExit_DebugMemory();
285 catch(std::exception& e)
287 log.FatalError(e.what());
291 log.FatalError(
"Unhandled exception @ main function;");