1.1 --- a/lemon/graph_to_eps.h Fri Feb 13 13:29:28 2009 +0100
1.2 +++ b/lemon/graph_to_eps.h Fri Feb 13 16:05:21 2009 +0000
1.3 @@ -29,8 +29,12 @@
1.4 #include<sys/time.h>
1.5 #include<ctime>
1.6 #else
1.7 +#ifndef WIN32_LEAN_AND_MEAN
1.8 #define WIN32_LEAN_AND_MEAN
1.9 +#endif
1.10 +#ifndef NOMINMAX
1.11 #define NOMINMAX
1.12 +#endif
1.13 #include<windows.h>
1.14 #endif
1.15
1.16 @@ -688,18 +692,30 @@
1.17 os << "%%CreationDate: " << cbuf;
1.18 #else
1.19 SYSTEMTIME time;
1.20 - char buf1[11], buf2[9], buf3[5];
1.21 -
1.22 GetSystemTime(&time);
1.23 +#if defined(_MSC_VER) && (_MSC_VER < 1500)
1.24 + LPWSTR buf1, buf2, buf3;
1.25 if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
1.26 - "ddd MMM dd", buf1, 11) &&
1.27 + L"ddd MMM dd", buf1, 11) &&
1.28 GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
1.29 - "HH':'mm':'ss", buf2, 9) &&
1.30 + L"HH':'mm':'ss", buf2, 9) &&
1.31 GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
1.32 - "yyyy", buf3, 5)) {
1.33 + L"yyyy", buf3, 5)) {
1.34 os << "%%CreationDate: " << buf1 << ' '
1.35 << buf2 << ' ' << buf3 << std::endl;
1.36 }
1.37 +#else
1.38 + char buf1[11], buf2[9], buf3[5];
1.39 + if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
1.40 + "ddd MMM dd", buf1, 11) &&
1.41 + GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
1.42 + "HH':'mm':'ss", buf2, 9) &&
1.43 + GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
1.44 + "yyyy", buf3, 5)) {
1.45 + os << "%%CreationDate: " << buf1 << ' '
1.46 + << buf2 << ' ' << buf3 << std::endl;
1.47 + }
1.48 +#endif
1.49 #endif
1.50 }
1.51
2.1 --- a/lemon/lp_base.cc Fri Feb 13 13:29:28 2009 +0100
2.2 +++ b/lemon/lp_base.cc Fri Feb 13 16:05:21 2009 +0000
2.3 @@ -22,7 +22,9 @@
2.4 #include <lemon/lp_base.h>
2.5 namespace lemon {
2.6
2.7 - const LpBase::Value LpBase::INF = std::numeric_limits<Value>::infinity();
2.8 - const LpBase::Value LpBase::NaN = std::numeric_limits<Value>::quiet_NaN();
2.9 + const LpBase::Value LpBase::INF =
2.10 + std::numeric_limits<LpBase::Value>::infinity();
2.11 + const LpBase::Value LpBase::NaN =
2.12 + std::numeric_limits<LpBase::Value>::quiet_NaN();
2.13
2.14 } //namespace lemon
3.1 --- a/lemon/lp_base.h Fri Feb 13 13:29:28 2009 +0100
3.2 +++ b/lemon/lp_base.h Fri Feb 13 16:05:21 2009 +0000
3.3 @@ -597,11 +597,11 @@
3.4 const Value &upperBound() const { return _ub; }
3.5 ///Is the constraint lower bounded?
3.6 bool lowerBounded() const {
3.7 - return _lb != -INF && !isnan(_lb);
3.8 + return _lb != -INF && !isNaN(_lb);
3.9 }
3.10 ///Is the constraint upper bounded?
3.11 bool upperBounded() const {
3.12 - return _ub != INF && !isnan(_ub);
3.13 + return _ub != INF && !isNaN(_ub);
3.14 }
3.15
3.16 };
3.17 @@ -1666,7 +1666,7 @@
3.18 inline LpBase::Constr operator<=(const LpBase::Value &n,
3.19 const LpBase::Constr &c) {
3.20 LpBase::Constr tmp(c);
3.21 - LEMON_ASSERT(isnan(tmp.lowerBound()), "Wrong LP constraint");
3.22 + LEMON_ASSERT(isNaN(tmp.lowerBound()), "Wrong LP constraint");
3.23 tmp.lowerBound()=n;
3.24 return tmp;
3.25 }
3.26 @@ -1678,7 +1678,7 @@
3.27 const LpBase::Value &n)
3.28 {
3.29 LpBase::Constr tmp(c);
3.30 - LEMON_ASSERT(isnan(tmp.upperBound()), "Wrong LP constraint");
3.31 + LEMON_ASSERT(isNaN(tmp.upperBound()), "Wrong LP constraint");
3.32 tmp.upperBound()=n;
3.33 return tmp;
3.34 }
3.35 @@ -1690,7 +1690,7 @@
3.36 inline LpBase::Constr operator>=(const LpBase::Value &n,
3.37 const LpBase::Constr &c) {
3.38 LpBase::Constr tmp(c);
3.39 - LEMON_ASSERT(isnan(tmp.upperBound()), "Wrong LP constraint");
3.40 + LEMON_ASSERT(isNaN(tmp.upperBound()), "Wrong LP constraint");
3.41 tmp.upperBound()=n;
3.42 return tmp;
3.43 }
3.44 @@ -1702,7 +1702,7 @@
3.45 const LpBase::Value &n)
3.46 {
3.47 LpBase::Constr tmp(c);
3.48 - LEMON_ASSERT(isnan(tmp.lowerBound()), "Wrong LP constraint");
3.49 + LEMON_ASSERT(isNaN(tmp.lowerBound()), "Wrong LP constraint");
3.50 tmp.lowerBound()=n;
3.51 return tmp;
3.52 }
4.1 --- a/lemon/math.h Fri Feb 13 13:29:28 2009 +0100
4.2 +++ b/lemon/math.h Fri Feb 13 16:05:21 2009 +0000
4.3 @@ -60,7 +60,7 @@
4.4 ///This function checks whether the parameter is NaN or not.
4.5 ///Is should be equivalent with std::isnan(), but it is not
4.6 ///provided by all compilers.
4.7 - inline bool isnan(double v)
4.8 + inline bool isNaN(double v)
4.9 {
4.10 return v!=v;
4.11 }
5.1 --- a/lemon/time_measure.h Fri Feb 13 13:29:28 2009 +0100
5.2 +++ b/lemon/time_measure.h Fri Feb 13 16:05:21 2009 +0000
5.3 @@ -24,11 +24,16 @@
5.4 ///\brief Tools for measuring cpu usage
5.5
5.6 #ifdef WIN32
5.7 +#ifndef WIN32_LEAN_AND_MEAN
5.8 #define WIN32_LEAN_AND_MEAN
5.9 +#endif
5.10 +#ifndef NOMINMAX
5.11 #define NOMINMAX
5.12 +#endif
5.13 #include <windows.h>
5.14 #include <cmath>
5.15 #else
5.16 +#include <unistd.h>
5.17 #include <sys/times.h>
5.18 #include <sys/time.h>
5.19 #endif