| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef _LIBCPP___ASSERTION_HANDLER |
| #define _LIBCPP___ASSERTION_HANDLER |
|
|
| #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) |
| # include <__cxx03/__config> |
| # include <__cxx03/__verbose_abort> |
| # include <__cxx03/__verbose_trap> |
| #else |
| # include <__config> |
| # include <__log_hardening_failure> |
| # include <__verbose_abort> |
| # include <__verbose_trap> |
| #endif |
|
|
| #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| # pragma GCC system_header |
| #endif |
|
|
| #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) |
|
|
| |
| |
| # if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG |
| # define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message) |
| # else |
| # define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_TRAP(message) |
| # endif |
|
|
| #else |
|
|
| # if _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_IGNORE |
| # define _LIBCPP_ASSERTION_HANDLER(message) ((void)0) |
|
|
| # elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_OBSERVE |
| # define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_LOG_HARDENING_FAILURE(message) |
|
|
| # elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE |
| # define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_TRAP(message) |
|
|
| # elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_ENFORCE |
| # define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message) |
|
|
| # else |
|
|
| # error _LIBCPP_ASSERTION_SEMANTIC must be set to one of the following values: \ |
| _LIBCPP_ASSERTION_SEMANTIC_IGNORE, \ |
| _LIBCPP_ASSERTION_SEMANTIC_OBSERVE, \ |
| _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE, \ |
| _LIBCPP_ASSERTION_SEMANTIC_ENFORCE |
|
|
| # endif |
|
|
| #endif |
|
|
| #endif |
|
|