From: Wolfgang Bangerth Date: Fri, 12 Aug 2005 03:30:30 +0000 (+0000) Subject: Make this file compile even if std::numeric_limits isn't available. X-Git-Tag: v8.0.0~13287 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4544d69bbc14e538df0603bdc39e3cf78aab06cd;p=dealii.git Make this file compile even if std::numeric_limits isn't available. git-svn-id: https://svn.dealii.org/trunk@11300 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/source/utilities.cc b/deal.II/base/source/utilities.cc index 96f35bbc5f..1f3a98b25a 100644 --- a/deal.II/base/source/utilities.cc +++ b/deal.II/base/source/utilities.cc @@ -30,7 +30,9 @@ # include #endif #ifdef HAVE_STD_NUMERIC_LIMITS -# include +# include +#else +# include #endif @@ -112,12 +114,17 @@ namespace Utilities std::ostrstream ss(s.c_str()); #endif - int i = std::numeric_limits::max(); +#ifdef HAVE_STD_NUMERIC_LIMITS + static const int max_int = std::numeric_limits::max(); +#else + static const int max_int = INT_MAX; +#endif + + int i = max_int; ss >> i; // check for errors - AssertThrow (i != std::numeric_limits::max(), - ExcCantConvertString (s)); + AssertThrow (i != max_int, ExcCantConvertString (s)); return i; }