Changes in lemon/bits/windows.cc [513:3f0ddf255524:511:879c55700cd4] in lemon
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/windows.cc
r513 r511 29 29 #define NOMINMAX 30 30 #endif 31 #ifdef UNICODE32 #undef UNICODE33 #endif34 31 #include <windows.h> 35 #ifdef LOCALE_INVARIANT36 #define MY_LOCALE LOCALE_INVARIANT37 #else38 #define MY_LOCALE LOCALE_NEUTRAL39 #endif40 32 #else 41 33 #include <unistd.h> … … 96 88 SYSTEMTIME time; 97 89 GetSystemTime(&time); 98 char buf1[11], buf2[9], buf3[5]; 99 if (GetDateFormat(MY_LOCALE, 0, &time, 100 ("ddd MMM dd"), buf1, 11) && 101 GetTimeFormat(MY_LOCALE, 0, &time, 102 ("HH':'mm':'ss"), buf2, 9) && 103 GetDateFormat(MY_LOCALE, 0, &time, 104 ("yyyy"), buf3, 5)) { 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) && 94 GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time, 95 L"HH':'mm':'ss", buf2, 9) && 96 GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, 97 L"yyyy", buf3, 5)) { 105 98 os << buf1 << ' ' << buf2 << ' ' << buf3; 106 99 } 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 107 111 else os << "unknown"; 108 112 #else
Note: See TracChangeset
for help on using the changeset viewer.