string_number_conversions: only check CXX_LIBRARY_HAS_CONSTEXPR.

CXX_LIBRARY_VERSION is irrelevant, because the only C++11 library
feature of any concern is whether numeric_limits’ min() and max() are
declared constexpr.

Crashpad is C++11-only as far as the language is concerned, and the
comment doesn’t need to call it out explicitly because static_assert()
is always available.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/809833002
This commit is contained in:
Mark Mentovai 2014-12-16 14:55:28 -05:00
parent d78b003ef1
commit 5adfa5039e

View File

@ -25,11 +25,11 @@
#include "util/stdlib/cxx.h"
// CONSTEXPR_STATIC_ASSERT will be a normal static_assert if the C++ library is
// 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 wont be usable with C++11s static_assert(). In that
// case, a run-time CHECK() will have to do.
#if CXX_LIBRARY_VERSION >= 2011 && CXX_LIBRARY_HAS_CONSTEXPR
// the C++11 library. If using an older C++ library, the
// std::numeric_limits<>::min() and max() functions will not be marked as
// constexpr, and thus wont be usable with static_assert(). In that case, a
// run-time CHECK() will have to do.
#if CXX_LIBRARY_HAS_CONSTEXPR
#define CONSTEXPR_STATIC_ASSERT(condition, message) \
static_assert(condition, message)
#else