]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make this file compile even if std::numeric_limits isn't available.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 12 Aug 2005 03:30:30 +0000 (03:30 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 12 Aug 2005 03:30:30 +0000 (03:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@11300 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/utilities.cc

index 96f35bbc5f5a31fa505edd4b3d82b5b2ff018147..1f3a98b25a84d08d7881048ce3771bbe00695028 100644 (file)
@@ -30,7 +30,9 @@
 #  include <strstream>
 #endif
 #ifdef HAVE_STD_NUMERIC_LIMITS
-# include <limits>
+#  include <limits>
+#else
+#  include <limits.h>
 #endif
 
 
@@ -112,12 +114,17 @@ namespace Utilities
     std::ostrstream ss(s.c_str());
 #endif
 
-    int i = std::numeric_limits<int>::max();
+#ifdef HAVE_STD_NUMERIC_LIMITS
+    static const int max_int = std::numeric_limits<int>::max();
+#else
+    static const int max_int = INT_MAX;
+#endif
+    
+    int i = max_int;
     ss >> i;
 
                                      // check for errors
-    AssertThrow (i != std::numeric_limits<int>::max(),
-                 ExcCantConvertString (s));
+    AssertThrow (i != max_int, ExcCantConvertString (s));
     
     return i;
   }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.