diff --git a/include/boost/detail/lcast_precision.hpp b/include/boost/detail/lcast_precision.hpp index 5bd96fd..ef23c8a 100644 --- a/include/boost/detail/lcast_precision.hpp +++ b/include/boost/detail/lcast_precision.hpp @@ -21,7 +21,13 @@ #include #endif -#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || \ + (defined(BOOST_MSVC) && (BOOST_MSVC<1310)) + +#define BOOST_LCAST_NO_COMPILE_TIME_PRECISION +#endif + +#ifdef BOOST_LCAST_NO_COMPILE_TIME_PRECISION #include #else #include @@ -31,7 +37,7 @@ namespace boost { namespace detail { class lcast_abstract_stub {}; -#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION // Calculate an argument to pass to std::ios_base::precision from // lexical_cast. See alternative implementation for broken standard // libraries in lcast_get_precision below. Keep them in sync, please. @@ -92,7 +98,7 @@ struct lcast_precision template inline std::streamsize lcast_get_precision(T* = 0) { -#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) +#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION return lcast_precision::value; #else // Follow lcast_precision algorithm at run-time: diff --git a/include/boost/lexical_cast.hpp b/include/boost/lexical_cast.hpp index 1cd23f7..8f40d47 100644 --- a/include/boost/lexical_cast.hpp +++ b/include/boost/lexical_cast.hpp @@ -307,7 +307,7 @@ namespace boost #undef BOOST_AUX_LEXICAL_CAST_DEF #undef BOOST_AUX_LEXICAL_CAST_DEF1 -#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION // This #if is in sync with lcast_precision // Helper for floating point types. @@ -376,7 +376,7 @@ namespace boost }; #endif // #ifndef DISABLE_WIDE_CHAR_SUPPORT -#endif // #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +#endif // #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION } namespace detail // '0' and '-' constants