COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/windows.cc

    r1092 r1135  
    2222#include<lemon/bits/windows.h>
    2323
    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
    2529#ifndef WIN32_LEAN_AND_MEAN
    2630#define WIN32_LEAN_AND_MEAN
     
    4145#include <unistd.h>
    4246#include <ctime>
    43 #ifndef WIN32
     47#ifndef LEMON_WIN32
    4448#include <sys/times.h>
    4549#endif
     
    5660                         double &cutime, double &cstime)
    5761    {
    58 #ifdef WIN32
     62#ifdef LEMON_WIN32
    5963      static const double ch = 4294967296.0e-7;
    6064      static const double cl = 1.0e-7;
     
    9599    {
    96100      std::ostringstream os;
    97 #ifdef WIN32
     101#ifdef LEMON_WIN32
    98102      SYSTEMTIME time;
    99103      GetSystemTime(&time);
    100104      char buf1[11], buf2[9], buf3[5];
    101           if (GetDateFormat(MY_LOCALE, 0, &time,
     105      if (GetDateFormat(MY_LOCALE, 0, &time,
    102106                        ("ddd MMM dd"), buf1, 11) &&
    103107          GetTimeFormat(MY_LOCALE, 0, &time,
     
    121125    int getWinRndSeed()
    122126    {
    123 #ifdef WIN32
     127#ifdef LEMON_WIN32
    124128      FILETIME time;
    125129      GetSystemTimeAsFileTime(&time);
     
    133137
    134138    WinLock::WinLock() {
    135 #ifdef WIN32
     139#ifdef LEMON_WIN32
    136140      CRITICAL_SECTION *lock = new CRITICAL_SECTION;
    137141      InitializeCriticalSection(lock);
     
    143147
    144148    WinLock::~WinLock() {
    145 #ifdef WIN32
     149#ifdef LEMON_WIN32
    146150      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    147151      DeleteCriticalSection(lock);
     
    151155
    152156    void WinLock::lock() {
    153 #ifdef WIN32
     157#ifdef LEMON_WIN32
    154158      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    155159      EnterCriticalSection(lock);
     
    158162
    159163    void WinLock::unlock() {
    160 #ifdef WIN32
     164#ifdef LEMON_WIN32
    161165      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    162166      LeaveCriticalSection(lock);
Note: See TracChangeset for help on using the changeset viewer.