summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-06-07 15:06:13 +0200
committerest31 <MTest31@outlook.com>2015-06-07 15:36:14 +0200
commit64704ecbc50c20d58bc8270a4af63e310a72b69f (patch)
tree5916b22d261ca746efa8d6d855190fbd6f09a257 /platform
parent8d6181729381ff4b06b754f1c491666f70c77a6e (diff)
Fix windows compilability
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/os_windows.cpp21
-rw-r--r--platform/windows/os_windows.h1
-rw-r--r--platform/winrt/os_winrt.cpp15
-rw-r--r--platform/winrt/os_winrt.h1
4 files changed, 14 insertions, 24 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index cdf9b007d1..fea2082822 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1829,13 +1829,14 @@ String OS_Windows::get_name() {
return "Windows";
}
-OS::Date OS_Windows::get_date() const {
+OS::Date OS_Windows::get_date(bool utc) const {
SYSTEMTIME systemtime;
- if (local)
+ if (utc)
GetSystemTime(&systemtime);
else
GetLocalTime(&systemtime);
+
Date date;
date.day=systemtime.wDay;
date.month=Month(systemtime.wMonth);
@@ -1858,20 +1859,6 @@ OS::Time OS_Windows::get_time(bool utc) const {
time.sec=systemtime.wSecond;
return time;
}
-OS::Time OS_Windows::get_time(bool utc) const {
-
- SYSTEMTIME systemtime;
- if (utc)
- GetSystemTime(&systemtime);
- else
- GetLocalTime(&systemtime);
-
- Time time;
- time.hour=systemtime.wHour;
- time.min=systemtime.wMinute;
- time.sec=systemtime.wSecond;
- return time;
-}
OS::TimeZoneInfo OS_Windows::get_time_zone_info() const {
TIME_ZONE_INFORMATION info;
@@ -1889,7 +1876,7 @@ OS::TimeZoneInfo OS_Windows::get_time_zone_info() const {
return ret;
}
-uint64_t OS_Windows::get_unix_time(bool local) const {
+uint64_t OS_Windows::get_unix_time() const {
FILETIME ft;
SYSTEMTIME st;
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 6b2eb19a76..31e030d02e 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -261,6 +261,7 @@ public:
virtual Date get_date(bool utc) const;
virtual Time get_time(bool utc) const;
+ virtual TimeZoneInfo get_time_zone_info() const;
virtual uint64_t get_unix_time() const;
virtual bool can_draw() const;
diff --git a/platform/winrt/os_winrt.cpp b/platform/winrt/os_winrt.cpp
index 24037f05d7..ab5953f980 100644
--- a/platform/winrt/os_winrt.cpp
+++ b/platform/winrt/os_winrt.cpp
@@ -442,10 +442,14 @@ String OSWinrt::get_name() {
return "WinRT";
}
-OS::Date OSWinrt::get_date() const {
+OS::Date OSWinrt::get_date(bool utc) const {
SYSTEMTIME systemtime;
- GetLocalTime(&systemtime);
+ if (utc)
+ GetSystemTime(&systemtime);
+ else
+ GetLocalTime(&systemtime);
+
Date date;
date.day=systemtime.wDay;
date.month=Month(systemtime.wMonth);
@@ -485,14 +489,11 @@ OS::TimeZoneInfo OS_Windows::get_time_zone_info() const {
return ret;
}
-uint64_t OSWinrt::get_unix_time(bool utc) const {
+uint64_t OSWinrt::get_unix_time() const {
FILETIME ft;
SYSTEMTIME st;
- if (utc)
- GetSystemTime(&systemtime);
- else
- GetLocalTime(&systemtime);
+ GetSystemTime(&systemtime);
SystemTimeToFileTime(&st, &ft);
SYSTEMTIME ep;
diff --git a/platform/winrt/os_winrt.h b/platform/winrt/os_winrt.h
index af44bd338e..b69feccae9 100644
--- a/platform/winrt/os_winrt.h
+++ b/platform/winrt/os_winrt.h
@@ -200,6 +200,7 @@ public:
virtual Date get_date(bool utc) const;
virtual Time get_time(bool utc) const;
+ virtual TimeZoneInfo get_time_zone_info() const;
virtual uint64_t get_unix_time() const;
virtual bool can_draw() const;