diff options
author | ExMix <Rahuba.youri@gmail.com> | 2013-02-26 11:49:38 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:51:15 +0300 |
commit | 0b8c44e2d601d4fe8eaff9bdc9b42045defb578f (patch) | |
tree | c529ce5bdd7bf9a80b69879848f1a67359c33deb /base | |
parent | 201a01fcaf07e2a0a3927a542215eb308e999421 (diff) |
different fixes for build on Windows platform
Diffstat (limited to 'base')
-rw-r--r-- | base/condition_windows_native.cpp | 1 | ||||
-rw-r--r-- | base/timer.cpp | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/base/condition_windows_native.cpp b/base/condition_windows_native.cpp index 73c3a1e8a6..ec8f87396f 100644 --- a/base/condition_windows_native.cpp +++ b/base/condition_windows_native.cpp @@ -168,7 +168,6 @@ namespace threads void Wait() { Wait(-1); - return false; } bool Wait(unsigned ms) diff --git a/base/timer.cpp b/base/timer.cpp index afc92bd0ea..7f6056b85a 100644 --- a/base/timer.cpp +++ b/base/timer.cpp @@ -78,6 +78,8 @@ namespace tzset(); return ret; +#elif defined(OMIM_OS_WINDOWS) + return mktime(tm); #else return timegm(tm); #endif @@ -88,8 +90,14 @@ string TimestampToString(time_t time) { tm * t = gmtime(&time); char buf[21] = { 0 }; +#ifdef OMIM_OS_WINDOWS + sprintf_s(buf, ARRAY_SIZE(buf), "%04d-%02d-%02dT%02d:%02d:%02dZ", t->tm_year + 1900, + t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); +#else ::snprintf(buf, ARRAY_SIZE(buf), "%04d-%02d-%02dT%02d:%02d:%02dZ", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); +#endif + return buf; } |