Index: lemon/graph_to_eps.h
===================================================================
--- lemon/graph_to_eps.h	(revision 440)
+++ lemon/graph_to_eps.h	(revision 509)
@@ -30,6 +30,10 @@
 #include<ctime>
 #else
+#ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
+#endif
+#ifndef NOMINMAX
 #define NOMINMAX
+#endif
 #include<windows.h>
 #endif
@@ -689,16 +693,28 @@
 #else
       SYSTEMTIME time;
-      char buf1[11], buf2[9], buf3[5];
-
       GetSystemTime(&time);
+#if defined(_MSC_VER) && (_MSC_VER < 1500)
+      LPWSTR buf1, buf2, buf3;
       if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
-                        "ddd MMM dd", buf1, 11) &&
+                        L"ddd MMM dd", buf1, 11) &&
           GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
-                        "HH':'mm':'ss", buf2, 9) &&
+                        L"HH':'mm':'ss", buf2, 9) &&
           GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
-                                "yyyy", buf3, 5)) {
+                        L"yyyy", buf3, 5)) {
         os << "%%CreationDate: " << buf1 << ' '
            << buf2 << ' ' << buf3 << std::endl;
       }
+#else
+        char buf1[11], buf2[9], buf3[5];
+        if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
+                          "ddd MMM dd", buf1, 11) &&
+            GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
+                          "HH':'mm':'ss", buf2, 9) &&
+            GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
+                          "yyyy", buf3, 5)) {
+          os << "%%CreationDate: " << buf1 << ' '
+             << buf2 << ' ' << buf3 << std::endl;
+        }
+#endif
 #endif
     }
Index: lemon/lp_base.cc
===================================================================
--- lemon/lp_base.cc	(revision 459)
+++ lemon/lp_base.cc	(revision 510)
@@ -23,6 +23,8 @@
 namespace lemon {
 
-  const LpBase::Value LpBase::INF = std::numeric_limits<Value>::infinity();
-  const LpBase::Value LpBase::NaN = std::numeric_limits<Value>::quiet_NaN();
+  const LpBase::Value LpBase::INF =
+    std::numeric_limits<LpBase::Value>::infinity();
+  const LpBase::Value LpBase::NaN =
+    std::numeric_limits<LpBase::Value>::quiet_NaN();
 
 } //namespace lemon
Index: lemon/lp_base.h
===================================================================
--- lemon/lp_base.h	(revision 471)
+++ lemon/lp_base.h	(revision 511)
@@ -598,9 +598,9 @@
       ///Is the constraint lower bounded?
       bool lowerBounded() const {
-        return _lb != -INF && !isnan(_lb);
+        return _lb != -INF && !isNaN(_lb);
       }
       ///Is the constraint upper bounded?
       bool upperBounded() const {
-        return _ub != INF && !isnan(_ub);
+        return _ub != INF && !isNaN(_ub);
       }
 
@@ -1667,5 +1667,5 @@
                                    const LpBase::Constr &c) {
     LpBase::Constr tmp(c);
-    LEMON_ASSERT(isnan(tmp.lowerBound()), "Wrong LP constraint");
+    LEMON_ASSERT(isNaN(tmp.lowerBound()), "Wrong LP constraint");
     tmp.lowerBound()=n;
     return tmp;
@@ -1679,5 +1679,5 @@
   {
     LpBase::Constr tmp(c);
-    LEMON_ASSERT(isnan(tmp.upperBound()), "Wrong LP constraint");
+    LEMON_ASSERT(isNaN(tmp.upperBound()), "Wrong LP constraint");
     tmp.upperBound()=n;
     return tmp;
@@ -1691,5 +1691,5 @@
                                    const LpBase::Constr &c) {
     LpBase::Constr tmp(c);
-    LEMON_ASSERT(isnan(tmp.upperBound()), "Wrong LP constraint");
+    LEMON_ASSERT(isNaN(tmp.upperBound()), "Wrong LP constraint");
     tmp.upperBound()=n;
     return tmp;
@@ -1703,5 +1703,5 @@
   {
     LpBase::Constr tmp(c);
-    LEMON_ASSERT(isnan(tmp.lowerBound()), "Wrong LP constraint");
+    LEMON_ASSERT(isNaN(tmp.lowerBound()), "Wrong LP constraint");
     tmp.lowerBound()=n;
     return tmp;
Index: lemon/math.h
===================================================================
--- lemon/math.h	(revision 470)
+++ lemon/math.h	(revision 511)
@@ -61,5 +61,5 @@
   ///Is should be equivalent with std::isnan(), but it is not
   ///provided by all compilers.
-  inline bool isnan(double v)
+  inline bool isNaN(double v)
     {
       return v!=v;
Index: lemon/time_measure.h
===================================================================
--- lemon/time_measure.h	(revision 440)
+++ lemon/time_measure.h	(revision 509)
@@ -25,9 +25,14 @@
 
 #ifdef WIN32
+#ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
+#endif
+#ifndef NOMINMAX
 #define NOMINMAX
+#endif
 #include <windows.h>
 #include <cmath>
 #else
+#include <unistd.h>
 #include <sys/times.h>
 #include <sys/time.h>
