mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
win: set CXX_LIBRARY_VERSION to 2011
Unfortunately VS2013's support of C++11 is partial. It supports the extended union definition, but does not fully support constexpr. So, update some locations where CXX_LIBRARY_VERSION is used where toolchain support is lacking. It works correctly in the locations where std::is_standard_layout is used. R=mark@chromium.org BUG=crashpad:1 Review URL: https://codereview.chromium.org/803273002
This commit is contained in:
parent
22cf9e28d5
commit
c23dcdc88a
@ -15,6 +15,15 @@
|
|||||||
#ifndef CRASHPAD_UTIL_STDLIB_CXX_H_
|
#ifndef CRASHPAD_UTIL_STDLIB_CXX_H_
|
||||||
#define CRASHPAD_UTIL_STDLIB_CXX_H_
|
#define CRASHPAD_UTIL_STDLIB_CXX_H_
|
||||||
|
|
||||||
|
#include "build/build_config.h"
|
||||||
|
|
||||||
|
#if defined(COMPILER_MSVC)
|
||||||
|
|
||||||
|
#define CXX_LIBRARY_VERSION 2011
|
||||||
|
#define CXX_LIBRARY_HAS_CONSTEXPR 0
|
||||||
|
|
||||||
|
#else // !COMPILER_MSVC
|
||||||
|
|
||||||
// <ciso646> doesn’t do very much, and under libc++, it will cause the
|
// <ciso646> doesn’t do very much, and under libc++, it will cause the
|
||||||
// _LIBCPP_VERSION macro to be defined properly. Under libstdc++, it doesn’t
|
// _LIBCPP_VERSION macro to be defined properly. Under libstdc++, it doesn’t
|
||||||
// cause __GLIBCXX__ to be defined, but if _LIBCPP_VERSION isn’t defined after
|
// cause __GLIBCXX__ to be defined, but if _LIBCPP_VERSION isn’t defined after
|
||||||
@ -50,8 +59,12 @@
|
|||||||
__GLIBCXX__ != 20120702ul) || /* GCC 4.5.4 */ \
|
__GLIBCXX__ != 20120702ul) || /* GCC 4.5.4 */ \
|
||||||
(defined(_LIBCPP_VERSION)))
|
(defined(_LIBCPP_VERSION)))
|
||||||
#define CXX_LIBRARY_VERSION 2011
|
#define CXX_LIBRARY_VERSION 2011
|
||||||
|
#define CXX_LIBRARY_HAS_CONSTEXPR 1
|
||||||
#else
|
#else
|
||||||
#define CXX_LIBRARY_VERSION 2003
|
#define CXX_LIBRARY_VERSION 2003
|
||||||
|
#define CXX_LIBRARY_HAS_CONSTEXPR 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif // COMPILER_MSVC
|
||||||
|
|
||||||
#endif // CRASHPAD_UTIL_STDLIB_CXX_H_
|
#endif // CRASHPAD_UTIL_STDLIB_CXX_H_
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
// the std::numeric_limits<>::min() and max() functions will not be marked as
|
// 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
|
// constexpr, and thus won’t be usable with C++11’s static_assert(). In that
|
||||||
// case, a run-time CHECK() will have to do.
|
// case, a run-time CHECK() will have to do.
|
||||||
#if CXX_LIBRARY_VERSION >= 2011
|
#if CXX_LIBRARY_VERSION >= 2011 && CXX_LIBRARY_HAS_CONSTEXPR
|
||||||
#define CONSTEXPR_STATIC_ASSERT(condition, message) \
|
#define CONSTEXPR_STATIC_ASSERT(condition, message) \
|
||||||
static_assert(condition, message)
|
static_assert(condition, message)
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user