YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ycommon.cpp
浏览该文件的文档.
1 /*
2  © 2009-2014 FrankHB.
3 
4  This file is part of the YSLib project, and may only be used,
5  modified, and distributed under the terms of the YSLib project
6  license, LICENSE.TXT. By continuing to use, modify, or distribute
7  this file you indicate that you have read the license and
8  understand and accept it fully.
9 */
10 
28 #include "YCLib/YModules.h"
29 #include YFM_YCLib_Debug
30 #include <cstring>
31 #include <cerrno>
32 #include <cstdarg>
33 #include YFM_YCLib_NativeAPI
34 
35 namespace platform
36 {
37 
38 void
40 {
41 #if YCL_DS
42  for(;;)
43  ::swiWaitForVBlank();
44 #else
45  std::abort();
46 #endif
47 }
48 
49 } // namespace platform;
50 
51 namespace platform_ex
52 {
53 
54 #if YCL_DS
55 bool
56 AllowSleep(bool b)
57 {
58  static bool bSleepEnabled(true); //与 libnds 默认的 ARM7 电源管理同步。
59  const bool b_old(bSleepEnabled);
60 
61  if(b != bSleepEnabled)
62  {
63  bSleepEnabled = b;
64  ::fifoSendValue32(FIFO_PM,
65  b ? PM_REQ_SLEEP_ENABLE : PM_REQ_SLEEP_DISABLE);
66  }
67  return b_old;
68 }
69 #elif YCL_MinGW32
70 
71 #endif
72 
73 }
74 
YB_NORETURN YF_API void terminate() ynothrow
异常终止函数。
Definition: ycommon.cpp:39
std::size_t size ynothrow