Index: .hgignore
===================================================================
--- .hgignore	(revision 298)
+++ .hgignore	(revision 514)
@@ -23,4 +23,5 @@
 lemon/stamp-h2
 doc/Doxyfile
+cmake/cmake.version
 .dirstamp
 .libs/*
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 503)
+++ CMakeLists.txt	(revision 515)
@@ -14,4 +14,7 @@
 INCLUDE(FindDoxygen)
 INCLUDE(FindGhostscript)
+
+INCLUDE(CheckTypeSize)
+CHECK_TYPE_SIZE("long long" LONG_LONG)
 
 ENABLE_TESTING()
Index: configure.ac
===================================================================
--- configure.ac	(revision 503)
+++ configure.ac	(revision 515)
@@ -24,4 +24,10 @@
 dnl Do compilation tests using the C++ compiler.
 AC_LANG([C++])
+
+dnl Check the existence of long long type.
+AC_CHECK_TYPE(long long, [long_long_found=yes], [long_long_found=no])
+if test x"$long_long_found" = x"yes"; then
+  AC_DEFINE([HAVE_LONG_LONG], [1], [Define to 1 if you have long long.])
+fi
 
 dnl Checks for programs.
@@ -117,4 +123,6 @@
 echo C++ compiles flags............ : $CXXFLAGS
 echo
+echo Compiler supports long long... : $long_long_found
+echo
 #echo GLPK support.................. : $lx_glpk_found
 #echo CPLEX support................. : $lx_cplex_found
Index: lemon/bits/default_map.h
===================================================================
--- lemon/bits/default_map.h	(revision 314)
+++ lemon/bits/default_map.h	(revision 515)
@@ -97,5 +97,5 @@
 
 
-#if defined __GNUC__ && !defined __STRICT_ANSI__
+#if defined HAVE_LONG_LONG
 
   // long long
Index: lemon/bits/windows.cc
===================================================================
--- lemon/bits/windows.cc	(revision 511)
+++ lemon/bits/windows.cc	(revision 513)
@@ -29,5 +29,13 @@
 #define NOMINMAX
 #endif
+#ifdef UNICODE
+#undef UNICODE
+#endif
 #include <windows.h>
+#ifdef LOCALE_INVARIANT
+#define MY_LOCALE LOCALE_INVARIANT
+#else
+#define MY_LOCALE LOCALE_NEUTRAL
+#endif
 #else
 #include <unistd.h>
@@ -88,25 +96,13 @@
       SYSTEMTIME time;
       GetSystemTime(&time);
-#if defined(_MSC_VER) && (_MSC_VER < 1500)
-      LPWSTR buf1, buf2, buf3;
-      if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
-                        L"ddd MMM dd", buf1, 11) &&
-          GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
-                        L"HH':'mm':'ss", buf2, 9) &&
-          GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
-                        L"yyyy", buf3, 5)) {
+      char buf1[11], buf2[9], buf3[5];
+	  if (GetDateFormat(MY_LOCALE, 0, &time,
+                        ("ddd MMM dd"), buf1, 11) &&
+          GetTimeFormat(MY_LOCALE, 0, &time,
+                        ("HH':'mm':'ss"), buf2, 9) &&
+          GetDateFormat(MY_LOCALE, 0, &time,
+                        ("yyyy"), buf3, 5)) {
         os << buf1 << ' ' << buf2 << ' ' << buf3;
       }
-#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 << buf1 << ' ' << buf2 << ' ' << buf3;
-      }
-#endif
       else os << "unknown";
 #else
Index: lemon/config.h.cmake
===================================================================
--- lemon/config.h.cmake	(revision 515)
+++ lemon/config.h.cmake	(revision 515)
@@ -0,0 +1,1 @@
+#cmakedefine HAVE_LONG_LONG 1
Index: lemon/config.h.in
===================================================================
--- lemon/config.h.in	(revision 1)
+++ lemon/config.h.in	(revision 515)
@@ -4,2 +4,5 @@
 /* Define to 1 if you have GLPK. */
 #undef HAVE_GLPK
+
+/* Define to 1 if you have long long */
+#undef HAVE_LONG_LONG
Index: lemon/tolerance.h
===================================================================
--- lemon/tolerance.h	(revision 280)
+++ lemon/tolerance.h	(revision 516)
@@ -39,6 +39,7 @@
   ///as a result of a probably inexact computation.
   ///
-  ///This is an abstract class, it should be specialized for all
-  ///numerical data types. These specialized classes like
+  ///The general implementation is suitable only if the data type is exact,
+  ///like the integer types, otherwise a specialized version must be
+  ///implemented. These specialized classes like
   ///Tolerance<double> may offer additional tuning parameters.
   ///
@@ -46,8 +47,4 @@
   ///\sa Tolerance<double>
   ///\sa Tolerance<long double>
-  ///\sa Tolerance<int>
-  ///\sa Tolerance<long long int>
-  ///\sa Tolerance<unsigned int>
-  ///\sa Tolerance<unsigned long long int>
 
   template<class T>
@@ -65,18 +62,18 @@
 
     ///Returns \c true if \c a is \e surely strictly less than \c b
-    static bool less(Value a,Value b) {return false;}
-    ///Returns \c true if \c a is \e surely different from \c b
-    static bool different(Value a,Value b) {return false;}
-    ///Returns \c true if \c a is \e surely positive
-    static bool positive(Value a) {return false;}
-    ///Returns \c true if \c a is \e surely negative
-    static bool negative(Value a) {return false;}
-    ///Returns \c true if \c a is \e surely non-zero
-    static bool nonZero(Value a) {return false;}
+    static bool less(Value a,Value b) {return a<b;}
+    ///Returns \c true if \c a is \e surely different from \c b
+    static bool different(Value a,Value b) {return a!=b;}
+    ///Returns \c true if \c a is \e surely positive
+    static bool positive(Value a) {return static_cast<Value>(0) < a;}
+    ///Returns \c true if \c a is \e surely negative
+    static bool negative(Value a) {return a < static_cast<Value>(0);}
+    ///Returns \c true if \c a is \e surely non-zero
+    static bool nonZero(Value a) {return a != static_cast<Value>(0);}
 
     ///@}
 
     ///Returns the zero value.
-    static Value zero() {return T();}
+    static Value zero() {return static_cast<Value>(0);}
 
     //   static bool finite(Value a) {}
@@ -239,211 +236,4 @@
   };
 
-  ///Integer specialization of Tolerance.
-
-  ///Integer specialization of Tolerance.
-  ///\sa Tolerance
-  template<>
-  class Tolerance<int>
-  {
-  public:
-    ///\e
-    typedef int Value;
-
-    ///\name Comparisons
-    ///See \ref lemon::Tolerance "Tolerance" for more details.
-
-    ///@{
-
-    ///Returns \c true if \c a is \e surely strictly less than \c b
-    static bool less(Value a,Value b) { return a<b;}
-    ///Returns \c true if \c a is \e surely different from \c b
-    static bool different(Value a,Value b) { return a!=b; }
-    ///Returns \c true if \c a is \e surely positive
-    static bool positive(Value a) { return 0<a; }
-    ///Returns \c true if \c a is \e surely negative
-    static bool negative(Value a) { return 0>a; }
-    ///Returns \c true if \c a is \e surely non-zero
-    static bool nonZero(Value a) { return a!=0; }
-
-    ///@}
-
-    ///Returns zero
-    static Value zero() {return 0;}
-  };
-
-  ///Unsigned integer specialization of Tolerance.
-
-  ///Unsigned integer specialization of Tolerance.
-  ///\sa Tolerance
-  template<>
-  class Tolerance<unsigned int>
-  {
-  public:
-    ///\e
-    typedef unsigned int Value;
-
-    ///\name Comparisons
-    ///See \ref lemon::Tolerance "Tolerance" for more details.
-
-    ///@{
-
-    ///Returns \c true if \c a is \e surely strictly less than \c b
-    static bool less(Value a,Value b) { return a<b;}
-    ///Returns \c true if \c a is \e surely different from \c b
-    static bool different(Value a,Value b) { return a!=b; }
-    ///Returns \c true if \c a is \e surely positive
-    static bool positive(Value a) { return 0<a; }
-    ///Returns \c true if \c a is \e surely negative
-    static bool negative(Value) { return false; }
-    ///Returns \c true if \c a is \e surely non-zero
-    static bool nonZero(Value a) { return a!=0; }
-
-    ///@}
-
-    ///Returns zero
-    static Value zero() {return 0;}
-  };
-
-
-  ///Long integer specialization of Tolerance.
-
-  ///Long integer specialization of Tolerance.
-  ///\sa Tolerance
-  template<>
-  class Tolerance<long int>
-  {
-  public:
-    ///\e
-    typedef long int Value;
-
-    ///\name Comparisons
-    ///See \ref lemon::Tolerance "Tolerance" for more details.
-
-    ///@{
-
-    ///Returns \c true if \c a is \e surely strictly less than \c b
-    static bool less(Value a,Value b) { return a<b;}
-    ///Returns \c true if \c a is \e surely different from \c b
-    static bool different(Value a,Value b) { return a!=b; }
-    ///Returns \c true if \c a is \e surely positive
-    static bool positive(Value a) { return 0<a; }
-    ///Returns \c true if \c a is \e surely negative
-    static bool negative(Value a) { return 0>a; }
-    ///Returns \c true if \c a is \e surely non-zero
-    static bool nonZero(Value a) { return a!=0;}
-
-    ///@}
-
-    ///Returns zero
-    static Value zero() {return 0;}
-  };
-
-  ///Unsigned long integer specialization of Tolerance.
-
-  ///Unsigned long integer specialization of Tolerance.
-  ///\sa Tolerance
-  template<>
-  class Tolerance<unsigned long int>
-  {
-  public:
-    ///\e
-    typedef unsigned long int Value;
-
-    ///\name Comparisons
-    ///See \ref lemon::Tolerance "Tolerance" for more details.
-
-    ///@{
-
-    ///Returns \c true if \c a is \e surely strictly less than \c b
-    static bool less(Value a,Value b) { return a<b;}
-    ///Returns \c true if \c a is \e surely different from \c b
-    static bool different(Value a,Value b) { return a!=b; }
-    ///Returns \c true if \c a is \e surely positive
-    static bool positive(Value a) { return 0<a; }
-    ///Returns \c true if \c a is \e surely negative
-    static bool negative(Value) { return false; }
-    ///Returns \c true if \c a is \e surely non-zero
-    static bool nonZero(Value a) { return a!=0;}
-
-    ///@}
-
-    ///Returns zero
-    static Value zero() {return 0;}
-  };
-
-#if defined __GNUC__ && !defined __STRICT_ANSI__
-
-  ///Long long integer specialization of Tolerance.
-
-  ///Long long integer specialization of Tolerance.
-  ///\warning This class (more exactly, type <tt>long long</tt>)
-  ///is not ansi compatible.
-  ///\sa Tolerance
-  template<>
-  class Tolerance<long long int>
-  {
-  public:
-    ///\e
-    typedef long long int Value;
-
-    ///\name Comparisons
-    ///See \ref lemon::Tolerance "Tolerance" for more details.
-
-    ///@{
-
-    ///Returns \c true if \c a is \e surely strictly less than \c b
-    static bool less(Value a,Value b) { return a<b;}
-    ///Returns \c true if \c a is \e surely different from \c b
-    static bool different(Value a,Value b) { return a!=b; }
-    ///Returns \c true if \c a is \e surely positive
-    static bool positive(Value a) { return 0<a; }
-    ///Returns \c true if \c a is \e surely negative
-    static bool negative(Value a) { return 0>a; }
-    ///Returns \c true if \c a is \e surely non-zero
-    static bool nonZero(Value a) { return a!=0;}
-
-    ///@}
-
-    ///Returns zero
-    static Value zero() {return 0;}
-  };
-
-  ///Unsigned long long integer specialization of Tolerance.
-
-  ///Unsigned long long integer specialization of Tolerance.
-  ///\warning This class (more exactly, type <tt>unsigned long long</tt>)
-  ///is not ansi compatible.
-  ///\sa Tolerance
-  template<>
-  class Tolerance<unsigned long long int>
-  {
-  public:
-    ///\e
-    typedef unsigned long long int Value;
-
-    ///\name Comparisons
-    ///See \ref lemon::Tolerance "Tolerance" for more details.
-
-    ///@{
-
-    ///Returns \c true if \c a is \e surely strictly less than \c b
-    static bool less(Value a,Value b) { return a<b;}
-    ///Returns \c true if \c a is \e surely different from \c b
-    static bool different(Value a,Value b) { return a!=b; }
-    ///Returns \c true if \c a is \e surely positive
-    static bool positive(Value a) { return 0<a; }
-    ///Returns \c true if \c a is \e surely negative
-    static bool negative(Value) { return false; }
-    ///Returns \c true if \c a is \e surely non-zero
-    static bool nonZero(Value a) { return a!=0;}
-
-    ///@}
-
-    ///Returns zero
-    static Value zero() {return 0;}
-  };
-
-#endif
-
   /// @}
 
