Chromium Code Reviews| Index: util/stdlib/string_number_conversion.cc |
| diff --git a/util/stdlib/string_number_conversion.cc b/util/stdlib/string_number_conversion.cc |
| index a7c7d519dedfb22bb9332af7685325919fdea42b..585a4f6d7efea43e71a0c95dc0fa375a26da24fd 100644 |
| --- a/util/stdlib/string_number_conversion.cc |
| +++ b/util/stdlib/string_number_conversion.cc |
| @@ -28,8 +28,9 @@ |
| // the C++11 library. If using an older C++ library when compiling C++11 code, |
| // the std::numeric_limits<>::min() and max() functions will not be marked as |
| // constexpr, and thus won’t be usable with C++11’s static_assert(). In that |
| -// case, a run-time CHECK() will have to do. |
| -#if CXX_LIBRARY_VERSION >= 2011 |
| +// case, a run-time CHECK() will have to do. Visual Studio is nominally C++11, |
| +// but does not fully support constexpr, so fall back to a CHECK. |
| +#if CXX_LIBRARY_VERSION >= 2011 && !defined(COMPILER_MSVC) |
|
Mark Mentovai
2014/12/15 23:33:19
Maybe we should do this with a CXX_HAS_CONSTEXPR m
scottmg
2014/12/15 23:38:18
Done.
|
| #define CONSTEXPR_STATIC_ASSERT(condition, message) \ |
| static_assert(condition, message) |
| #else |