# HG changeset patch
# User "Janos Tapolcai <tapolcai@tmit.bme.hu>"
# Date 1234859983 -3600
# Node ID 28b3dec413f1afefe092ed44c22382351929d4d2
# Parent 879c55700cd4bf2903772de56606fc0aa6e99710
trying some durty hacking for windows
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 | #define UNICODE |
| | 32 | #define _T(x) L ## x |
| | 33 | |
| 31 | 34 | #include <windows.h> |
| 32 | 35 | #else |
| 33 | 36 | #include <unistd.h> |
| 34 | 37 | #include <ctime> |
| 35 | 38 | #include <sys/times.h> |
| 36 | 39 | #include <sys/time.h> |
| | 40 | #define _T(x) x |
| 37 | 41 | #endif |
| 38 | 42 | |
| 39 | 43 | #include <cmath> |
| … |
… |
|
| 88 | 92 | SYSTEMTIME time; |
| 89 | 93 | GetSystemTime(&time); |
| 90 | 94 | #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) && |
| | 95 | wchar_t buf1[11], buf2[9], buf3[5]; |
| | 96 | #else |
| | 97 | char buf1[11], buf2[9], buf3[5]; |
| | 98 | #endif |
| | 99 | if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
| | 100 | _T("ddd MMM dd"), buf1, 11) && |
| 94 | 101 | GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time, |
| 95 | | L"HH':'mm':'ss", buf2, 9) && |
| | 102 | _T("HH':'mm':'ss"), buf2, 9) && |
| 96 | 103 | GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
| 97 | | L"yyyy", buf3, 5)) { |
| | 104 | _T("yyyy"), buf3, 5)) { |
| 98 | 105 | os << buf1 << ' ' << buf2 << ' ' << buf3; |
| 99 | 106 | } |
| 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 | 107 | else os << "unknown"; |
| 112 | 108 | #else |
| 113 | 109 | timeval tv; |