Index: include/istream =================================================================== --- include/istream +++ include/istream @@ -711,6 +711,7 @@ ios_base::iostate __err = ios_base::goodbit; long __temp; use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __temp); +#if __SIZEOF_INT__ != __SIZEOF_LONG__ if (__temp < numeric_limits::min()) { __err |= ios_base::failbit; @@ -723,6 +724,9 @@ } else __n = static_cast(__temp); +#else + __n = static_cast(__temp); +#endif this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS Index: src/string.cpp =================================================================== --- src/string.cpp +++ src/string.cpp @@ -88,8 +88,10 @@ { // Use long as no Standard string to integer exists. long r = as_integer_helper( func, s, idx, base, strtol ); +#if __SIZEOF_INT__ != __SIZEOF_LONG__ if (r < numeric_limits::min() || numeric_limits::max() < r) throw_from_string_out_of_range(func); +#endif return static_cast(r); } @@ -133,8 +135,10 @@ { // Use long as no Stantard string to integer exists. long r = as_integer_helper( func, s, idx, base, wcstol ); +#if __SIZEOF_INT__ != __SIZEOF_LONG__ if (r < numeric_limits::min() || numeric_limits::max() < r) throw_from_string_out_of_range(func); +#endif return static_cast(r); }