Changeset 1134:f70f688d9ef9 in lemon-main for lemon/bits/windows.cc
- Timestamp:
- 04/28/15 18:07:07 (9 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/windows.cc
r1092 r1134 22 22 #include<lemon/bits/windows.h> 23 23 24 #ifdef WIN3224 #ifdef LEMON_WIN32 25 25 #ifndef WIN32_LEAN_AND_MEAN 26 26 #define WIN32_LEAN_AND_MEAN … … 41 41 #include <unistd.h> 42 42 #include <ctime> 43 #ifndef WIN3243 #ifndef LEMON_WIN32 44 44 #include <sys/times.h> 45 45 #endif … … 56 56 double &cutime, double &cstime) 57 57 { 58 #ifdef WIN3258 #ifdef LEMON_WIN32 59 59 static const double ch = 4294967296.0e-7; 60 60 static const double cl = 1.0e-7; … … 95 95 { 96 96 std::ostringstream os; 97 #ifdef WIN3297 #ifdef LEMON_WIN32 98 98 SYSTEMTIME time; 99 99 GetSystemTime(&time); 100 100 char buf1[11], buf2[9], buf3[5]; 101 101 if (GetDateFormat(MY_LOCALE, 0, &time, 102 102 ("ddd MMM dd"), buf1, 11) && 103 103 GetTimeFormat(MY_LOCALE, 0, &time, … … 121 121 int getWinRndSeed() 122 122 { 123 #ifdef WIN32123 #ifdef LEMON_WIN32 124 124 FILETIME time; 125 125 GetSystemTimeAsFileTime(&time); … … 133 133 134 134 WinLock::WinLock() { 135 #ifdef WIN32135 #ifdef LEMON_WIN32 136 136 CRITICAL_SECTION *lock = new CRITICAL_SECTION; 137 137 InitializeCriticalSection(lock); … … 143 143 144 144 WinLock::~WinLock() { 145 #ifdef WIN32145 #ifdef LEMON_WIN32 146 146 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 147 147 DeleteCriticalSection(lock); … … 151 151 152 152 void WinLock::lock() { 153 #ifdef WIN32153 #ifdef LEMON_WIN32 154 154 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 155 155 EnterCriticalSection(lock); … … 158 158 159 159 void WinLock::unlock() { 160 #ifdef WIN32160 #ifdef LEMON_WIN32 161 161 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 162 162 LeaveCriticalSection(lock);
Note: See TracChangeset
for help on using the changeset viewer.