COIN-OR::LEMON - Graph Library

Changeset 1340:f70f688d9ef9 in lemon


Ignore:
Timestamp:
04/28/15 18:07:07 (5 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Replace #define WIN32 (#595)

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r1327 r1340  
    6666FIND_PACKAGE(Doxygen)
    6767FIND_PACKAGE(Ghostscript)
     68
     69IF(WIN32)
     70  SET(LEMON_WIN32 TRUE)
     71ENDIF(WIN32)
    6872
    6973SET(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.")
  • lemon/bits/windows.cc

    r1270 r1340  
    2222#include<lemon/bits/windows.h>
    2323
    24 #ifdef WIN32
     24#ifdef LEMON_WIN32
    2525#ifndef WIN32_LEAN_AND_MEAN
    2626#define WIN32_LEAN_AND_MEAN
     
    4141#include <unistd.h>
    4242#include <ctime>
    43 #ifndef WIN32
     43#ifndef LEMON_WIN32
    4444#include <sys/times.h>
    4545#endif
     
    5656                         double &cutime, double &cstime)
    5757    {
    58 #ifdef WIN32
     58#ifdef LEMON_WIN32
    5959      static const double ch = 4294967296.0e-7;
    6060      static const double cl = 1.0e-7;
     
    9595    {
    9696      std::ostringstream os;
    97 #ifdef WIN32
     97#ifdef LEMON_WIN32
    9898      SYSTEMTIME time;
    9999      GetSystemTime(&time);
    100100      char buf1[11], buf2[9], buf3[5];
    101           if (GetDateFormat(MY_LOCALE, 0, &time,
     101      if (GetDateFormat(MY_LOCALE, 0, &time,
    102102                        ("ddd MMM dd"), buf1, 11) &&
    103103          GetTimeFormat(MY_LOCALE, 0, &time,
     
    121121    int getWinRndSeed()
    122122    {
    123 #ifdef WIN32
     123#ifdef LEMON_WIN32
    124124      FILETIME time;
    125125      GetSystemTimeAsFileTime(&time);
     
    133133
    134134    WinLock::WinLock() {
    135 #ifdef WIN32
     135#ifdef LEMON_WIN32
    136136      CRITICAL_SECTION *lock = new CRITICAL_SECTION;
    137137      InitializeCriticalSection(lock);
     
    143143
    144144    WinLock::~WinLock() {
    145 #ifdef WIN32
     145#ifdef LEMON_WIN32
    146146      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    147147      DeleteCriticalSection(lock);
     
    151151
    152152    void WinLock::lock() {
    153 #ifdef WIN32
     153#ifdef LEMON_WIN32
    154154      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    155155      EnterCriticalSection(lock);
     
    158158
    159159    void WinLock::unlock() {
    160 #ifdef WIN32
     160#ifdef LEMON_WIN32
    161161      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    162162      LeaveCriticalSection(lock);
  • lemon/bits/windows.h

    r1270 r1340  
    2020#define LEMON_BITS_WINDOWS_H
    2121
     22#include <lemon/config.h>
    2223#include <string>
    2324
     
    3536      ~WinLock();
    3637      void lock();
    37       void unlock();
     38      void unlock();\
    3839    private:
    3940      void *_repr;
  • lemon/config.h.in

    r1306 r1340  
     1#ifndef LEMON_CONFIG_H
     2#define LEMON_CONFIG_H
     3
    14#define LEMON_VERSION "@PROJECT_VERSION@"
    25#cmakedefine LEMON_HAVE_LONG_LONG 1
     6
     7#cmakedefine LEMON_WIN32 1
    38
    49#cmakedefine LEMON_HAVE_LP 1
     
    1015#cmakedefine LEMON_HAVE_CBC 1
    1116
    12 #define _LEMON_CPLEX 1
    13 #define _LEMON_CLP 2
    14 #define _LEMON_GLPK 3
    15 #define _LEMON_SOPLEX 4
    16 #define _LEMON_CBC 5
     17#define LEMON_CPLEX_ 1
     18#define LEMON_CLP_ 2
     19#define LEMON_GLPK_ 3
     20#define LEMON_SOPLEX_ 4
     21#define LEMON_CBC_ 5
    1722
    18 #cmakedefine LEMON_DEFAULT_LP _LEMON_@LEMON_DEFAULT_LP@
    19 #cmakedefine LEMON_DEFAULT_MIP _LEMON_@LEMON_DEFAULT_MIP@
     23#cmakedefine LEMON_DEFAULT_LP LEMON_@LEMON_DEFAULT_LP@_
     24#cmakedefine LEMON_DEFAULT_MIP LEMON_@LEMON_DEFAULT_MIP@_
    2025
    2126#cmakedefine LEMON_USE_PTHREAD 1
    2227#cmakedefine LEMON_USE_WIN32_THREADS 1
     28
     29#endif
  • lemon/graph_to_eps.h

    r1291 r1340  
    2626#include<vector>
    2727
    28 #ifndef WIN32
     28#ifndef LEMON_WIN32
    2929#include<sys/time.h>
    3030#include<ctime>
     
    675675    {
    676676      os << "%%CreationDate: ";
    677 #ifndef WIN32
     677#ifndef LEMON_WIN32
    678678      timeval tv;
    679679      gettimeofday(&tv, 0);
  • lemon/lp.h

    r1323 r1340  
    2323
    2424
    25 #if LEMON_DEFAULT_LP == _LEMON_GLPK || LEMON_DEFAULT_MIP == _LEMON_GLPK
     25#if LEMON_DEFAULT_LP == LEMON_GLPK_ || LEMON_DEFAULT_MIP == LEMON_GLPK_
    2626#include <lemon/glpk.h>
    2727#endif
    28 #if LEMON_DEFAULT_LP == _LEMON_CPLEX || LEMON_DEFAULT_MIP == _LEMON_CPLEX
     28#if LEMON_DEFAULT_LP == LEMON_CPLEX_ || LEMON_DEFAULT_MIP == LEMON_CPLEX_
    2929#include <lemon/cplex.h>
    3030#endif
    31 #if LEMON_DEFAULT_LP == _LEMON_SOPLEX
     31#if LEMON_DEFAULT_LP == LEMON_SOPLEX_
    3232#include <lemon/soplex.h>
    3333#endif
    34 #if LEMON_DEFAULT_LP == _LEMON_CLP
     34#if LEMON_DEFAULT_LP == LEMON_CLP_
    3535#include <lemon/clp.h>
    3636#endif
    37 #if LEMON_DEFAULT_MIP == _LEMON_CBC
     37#if LEMON_DEFAULT_MIP == LEMON_CBC_
    3838#include <lemon/cbc.h>
    3939#endif
     
    5050  ///\ingroup lp_group
    5151  ///
    52   ///Currently, the possible values are \c _LEMON_GLPK, \c LEMON__CPLEX,
    53   ///\c _LEMON_SOPLEX or \c LEMON__CLP
     52  ///Currently, the possible values are \c LEMON_GLPK_, \c LEMON_CPLEX_,
     53  ///\c LEMON_SOPLEX_ or \c LEMON_CLP_
    5454#define LEMON_DEFAULT_LP SOLVER
    5555  ///The default LP solver
     
    6666  ///\ingroup lp_group
    6767  ///
    68   ///Currently, the possible values are \c _LEMON_GLPK, \c LEMON__CPLEX
    69   ///or \c _LEMON_CBC
     68  ///Currently, the possible values are \c LEMON_GLPK_, \c LEMON_CPLEX_
     69  ///or \c LEMON_CBC_
    7070#define LEMON_DEFAULT_MIP SOLVER
    7171  ///The default MIP solver.
     
    7777  typedef GlpkMip Mip;
    7878#else
    79 #if LEMON_DEFAULT_LP == _LEMON_GLPK
     79#if LEMON_DEFAULT_LP == LEMON_GLPK_
    8080  typedef GlpkLp Lp;
    81 #elif LEMON_DEFAULT_LP == _LEMON_CPLEX
     81#elif LEMON_DEFAULT_LP == LEMON_CPLEX_
    8282  typedef CplexLp Lp;
    83 #elif LEMON_DEFAULT_LP == _LEMON_SOPLEX
     83#elif LEMON_DEFAULT_LP == LEMON_SOPLEX_
    8484  typedef SoplexLp Lp;
    85 #elif LEMON_DEFAULT_LP == _LEMON_CLP
     85#elif LEMON_DEFAULT_LP == LEMON_CLP_
    8686  typedef ClpLp Lp;
    8787#endif
    88 #if LEMON_DEFAULT_MIP == _LEMON_GLPK
     88#if LEMON_DEFAULT_MIP == LEMON_GLPK_
    8989  typedef GlpkMip Mip;
    90 #elif LEMON_DEFAULT_MIP == _LEMON_CPLEX
     90#elif LEMON_DEFAULT_MIP == LEMON_CPLEX_
    9191  typedef CplexMip Mip;
    92 #elif LEMON_DEFAULT_MIP == _LEMON_CBC
     92#elif LEMON_DEFAULT_MIP == LEMON_CBC_
    9393  typedef CbcMip Mip;
    9494#endif
  • lemon/random.h

    r1328 r1340  
    6363#define LEMON_RANDOM_H
    6464
     65#include <lemon/config.h>
     66
    6567#include <algorithm>
    6668#include <iterator>
     
    7274#include <lemon/dim2.h>
    7375
    74 #ifndef WIN32
     76#ifndef LEMON_WIN32
    7577#include <sys/time.h>
    7678#include <ctime>
     
    606608    /// \return Currently always \c true.
    607609    bool seed() {
    608 #ifndef WIN32
     610#ifndef LEMON_WIN32
    609611      if (seedFromFile("/dev/urandom", 0)) return true;
    610612#endif
     
    626628    /// \param offset The offset, from the file read.
    627629    /// \return \c true when the seeding successes.
    628 #ifndef WIN32
     630#ifndef LEMON_WIN32
    629631    bool seedFromFile(const std::string& file = "/dev/urandom", int offset = 0)
    630632#else
     
    648650    /// \return Currently always \c true.
    649651    bool seedFromTime() {
    650 #ifndef WIN32
     652#ifndef LEMON_WIN32
    651653      timeval tv;
    652654      gettimeofday(&tv, 0);
  • lemon/time_measure.h

    r1270 r1340  
    2424///\brief Tools for measuring cpu usage
    2525
    26 #ifdef WIN32
     26#include <lemon/config.h>
     27
     28#ifdef LEMON_WIN32
    2729#include <lemon/bits/windows.h>
    2830#else
     
    103105    void stamp()
    104106    {
    105 #ifndef WIN32
     107#ifndef LEMON_WIN32
    106108      timeval tv;
    107109      gettimeofday(&tv, 0);
Note: See TracChangeset for help on using the changeset viewer.