Changes in lemon/bits/windows.cc [1092:dceba191c00d:1135:c199e9976d93] in lemon-main
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/windows.cc
r1092 r1135 22 22 #include<lemon/bits/windows.h> 23 23 24 #ifdef WIN32 24 #if defined(LEMON_WIN32) && defined(__GNUC__) 25 #pragma GCC diagnostic ignored "-Wold-style-cast" 26 #endif 27 28 #ifdef LEMON_WIN32 25 29 #ifndef WIN32_LEAN_AND_MEAN 26 30 #define WIN32_LEAN_AND_MEAN … … 41 45 #include <unistd.h> 42 46 #include <ctime> 43 #ifndef WIN3247 #ifndef LEMON_WIN32 44 48 #include <sys/times.h> 45 49 #endif … … 56 60 double &cutime, double &cstime) 57 61 { 58 #ifdef WIN3262 #ifdef LEMON_WIN32 59 63 static const double ch = 4294967296.0e-7; 60 64 static const double cl = 1.0e-7; … … 95 99 { 96 100 std::ostringstream os; 97 #ifdef WIN32101 #ifdef LEMON_WIN32 98 102 SYSTEMTIME time; 99 103 GetSystemTime(&time); 100 104 char buf1[11], buf2[9], buf3[5]; 101 105 if (GetDateFormat(MY_LOCALE, 0, &time, 102 106 ("ddd MMM dd"), buf1, 11) && 103 107 GetTimeFormat(MY_LOCALE, 0, &time, … … 121 125 int getWinRndSeed() 122 126 { 123 #ifdef WIN32127 #ifdef LEMON_WIN32 124 128 FILETIME time; 125 129 GetSystemTimeAsFileTime(&time); … … 133 137 134 138 WinLock::WinLock() { 135 #ifdef WIN32139 #ifdef LEMON_WIN32 136 140 CRITICAL_SECTION *lock = new CRITICAL_SECTION; 137 141 InitializeCriticalSection(lock); … … 143 147 144 148 WinLock::~WinLock() { 145 #ifdef WIN32149 #ifdef LEMON_WIN32 146 150 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 147 151 DeleteCriticalSection(lock); … … 151 155 152 156 void WinLock::lock() { 153 #ifdef WIN32157 #ifdef LEMON_WIN32 154 158 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 155 159 EnterCriticalSection(lock); … … 158 162 159 163 void WinLock::unlock() { 160 #ifdef WIN32164 #ifdef LEMON_WIN32 161 165 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 162 166 LeaveCriticalSection(lock);
Note: See TracChangeset
for help on using the changeset viewer.