# HG changeset patch
# User Janos Tapolcai <tapolcai@tmit.bme.hu>
# Date 1234890607 -3600
# Node ID 0316fe05c4ecc341f4b00380111a5bd5acf418f6
# Parent 879c55700cd4bf2903772de56606fc0aa6e99710
Further fixes to windows.cc (#215)
diff --git a/lemon/bits/windows.cc b/lemon/bits/windows.cc
a
|
b
|
|
28 | 28 | #ifndef NOMINMAX |
29 | 29 | #define NOMINMAX |
30 | 30 | #endif |
| 31 | #ifdef UNICODE |
| 32 | #undef UNICODE |
| 33 | #endif |
31 | 34 | #include <windows.h> |
32 | 35 | #else |
33 | 36 | #include <unistd.h> |
… |
… |
|
87 | 90 | #ifdef WIN32 |
88 | 91 | SYSTEMTIME time; |
89 | 92 | GetSystemTime(&time); |
90 | | #if defined(_MSC_VER) && (_MSC_VER < 1500) |
91 | | LPWSTR buf1, buf2, buf3; |
92 | | if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
93 | | L"ddd MMM dd", buf1, 11) && |
| 93 | char buf1[11], buf2[9], buf3[5]; |
| 94 | if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
| 95 | ("ddd MMM dd"), buf1, 11) && |
94 | 96 | GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time, |
95 | | L"HH':'mm':'ss", buf2, 9) && |
| 97 | ("HH':'mm':'ss"), buf2, 9) && |
96 | 98 | GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
97 | | L"yyyy", buf3, 5)) { |
| 99 | ("yyyy"), buf3, 5)) { |
98 | 100 | os << buf1 << ' ' << buf2 << ' ' << buf3; |
99 | 101 | } |
100 | | #else |
101 | | char buf1[11], buf2[9], buf3[5]; |
102 | | if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
103 | | "ddd MMM dd", buf1, 11) && |
104 | | GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time, |
105 | | "HH':'mm':'ss", buf2, 9) && |
106 | | GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
107 | | "yyyy", buf3, 5)) { |
108 | | os << buf1 << ' ' << buf2 << ' ' << buf3; |
109 | | } |
110 | | #endif |
111 | 102 | else os << "unknown"; |
112 | 103 | #else |
113 | 104 | timeval tv; |