|
25 | 25 | # pragma GCC system_header
|
26 | 26 | #endif
|
27 | 27 |
|
28 |
| -#if _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_IGNORE |
29 |
| -# define _LIBCPP_ASSERTION_HANDLER(message) ((void)0) |
| 28 | +#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) |
| 29 | + |
| 30 | +// Keep the old implementation that doesn't support assertion semantics for backward compatibility with the frozen C++03 |
| 31 | +// mode. |
| 32 | +# if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG |
| 33 | +# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message) |
| 34 | +# else |
| 35 | +# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_TRAP(message) |
| 36 | +# endif // _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG |
30 | 37 |
|
31 |
| -#elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_OBSERVE |
32 |
| -# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_LOG_ERROR(::std::_LogErrorReason::_HardeningFailure, message) |
| 38 | +#else |
33 | 39 |
|
34 |
| -#elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE |
35 |
| -# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_TRAP(message) |
| 40 | +# if _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_IGNORE |
| 41 | +# define _LIBCPP_ASSERTION_HANDLER(message) ((void)0) |
36 | 42 |
|
37 |
| -#elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_ENFORCE |
38 |
| -# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message) |
| 43 | +# elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_OBSERVE |
| 44 | +# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_LOG_ERROR(::std::_LogErrorReason::_HardeningFailure, message) |
39 | 45 |
|
40 |
| -#else |
| 46 | +# elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE |
| 47 | +# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_TRAP(message) |
41 | 48 |
|
42 |
| -# error _LIBCPP_ASSERTION_SEMANTIC must be set to one of the following values: \ |
| 49 | +# elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_ENFORCE |
| 50 | +# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message) |
| 51 | + |
| 52 | +# else |
| 53 | + |
| 54 | +# error _LIBCPP_ASSERTION_SEMANTIC must be set to one of the following values: \ |
43 | 55 | _LIBCPP_ASSERTION_SEMANTIC_IGNORE, \
|
44 | 56 | _LIBCPP_ASSERTION_SEMANTIC_OBSERVE, \
|
45 | 57 | _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE, \
|
46 | 58 | _LIBCPP_ASSERTION_SEMANTIC_ENFORCE
|
47 | 59 |
|
48 |
| -#endif // _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_IGNORE |
| 60 | +# endif // _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_IGNORE |
| 61 | + |
| 62 | +#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) |
49 | 63 |
|
50 | 64 | #endif // _LIBCPP___ASSERTION_HANDLER
|
0 commit comments