mirror of
https://github.com/yawut/SDL.git
synced 2026-10-23 15:12:41 -05:00
Fixed compiling on Windows Mobile SDK 5.0 with Visual Studio 2008
This commit is contained in:
@@ -32,11 +32,20 @@
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_Windows(SDL_PowerState * state, int *seconds, int *percent)
|
||||
{
|
||||
#ifdef _WIN32_WCE
|
||||
SYSTEM_POWER_STATUS_EX status;
|
||||
#else
|
||||
SYSTEM_POWER_STATUS status;
|
||||
#endif
|
||||
SDL_bool need_details = SDL_FALSE;
|
||||
|
||||
/* This API should exist back to Win95 and Windows CE. */
|
||||
if (!GetSystemPowerStatus(&status)) {
|
||||
#ifdef _WIN32_WCE
|
||||
if (!GetSystemPowerStatusEx(&status, FALSE))
|
||||
#else
|
||||
if (!GetSystemPowerStatus(&status))
|
||||
#endif
|
||||
{
|
||||
/* !!! FIXME: push GetLastError() into SDL_GetError() */
|
||||
*state = SDL_POWERSTATE_UNKNOWN;
|
||||
} else if (status.BatteryFlag == 0xFF) { /* unknown state */
|
||||
|
||||
Reference in New Issue
Block a user