mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-14 17:30:09 +08:00
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:
parent
d78b003ef1
commit
5adfa5039e
@ -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 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 && 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 won’t 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user