diff -r f28af6829e54 -r 5c247b4dc708 lemon/bits/windows.cc --- a/lemon/bits/windows.cc Thu Apr 02 14:08:38 2015 +0200 +++ b/lemon/bits/windows.cc Tue Apr 28 18:12:39 2015 +0200 @@ -21,7 +21,11 @@ #include -#ifdef WIN32 +#if defined(LEMON_WIN32) && defined(__GNUC__) +#pragma GCC diagnostic ignored "-Wold-style-cast" +#endif + +#ifdef LEMON_WIN32 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif @@ -40,7 +44,7 @@ #else #include #include -#ifndef WIN32 +#ifndef LEMON_WIN32 #include #endif #include @@ -55,7 +59,7 @@ double &utime, double &stime, double &cutime, double &cstime) { -#ifdef WIN32 +#ifdef LEMON_WIN32 static const double ch = 4294967296.0e-7; static const double cl = 1.0e-7; @@ -94,11 +98,11 @@ std::string getWinFormattedDate() { std::ostringstream os; -#ifdef WIN32 +#ifdef LEMON_WIN32 SYSTEMTIME time; GetSystemTime(&time); char buf1[11], buf2[9], buf3[5]; - if (GetDateFormat(MY_LOCALE, 0, &time, + if (GetDateFormat(MY_LOCALE, 0, &time, ("ddd MMM dd"), buf1, 11) && GetTimeFormat(MY_LOCALE, 0, &time, ("HH':'mm':'ss"), buf2, 9) && @@ -120,7 +124,7 @@ int getWinRndSeed() { -#ifdef WIN32 +#ifdef LEMON_WIN32 FILETIME time; GetSystemTimeAsFileTime(&time); return GetCurrentProcessId() + time.dwHighDateTime + time.dwLowDateTime; @@ -132,7 +136,7 @@ } WinLock::WinLock() { -#ifdef WIN32 +#ifdef LEMON_WIN32 CRITICAL_SECTION *lock = new CRITICAL_SECTION; InitializeCriticalSection(lock); _repr = lock; @@ -142,7 +146,7 @@ } WinLock::~WinLock() { -#ifdef WIN32 +#ifdef LEMON_WIN32 CRITICAL_SECTION *lock = static_cast(_repr); DeleteCriticalSection(lock); delete lock; @@ -150,14 +154,14 @@ } void WinLock::lock() { -#ifdef WIN32 +#ifdef LEMON_WIN32 CRITICAL_SECTION *lock = static_cast(_repr); EnterCriticalSection(lock); #endif } void WinLock::unlock() { -#ifdef WIN32 +#ifdef LEMON_WIN32 CRITICAL_SECTION *lock = static_cast(_repr); LeaveCriticalSection(lock); #endif