... | ... |
@@ -86,50 +86,52 @@ |
86 | 86 |
# undef LEMON_ASSERT_HANDLER |
87 | 87 |
# define LEMON_ASSERT_HANDLER ::lemon::assert_fail_log |
88 | 88 |
#elif defined LEMON_ASSERT_ABORT |
89 | 89 |
# undef LEMON_ASSERT_HANDLER |
90 | 90 |
# define LEMON_ASSERT_HANDLER ::lemon::assert_fail_abort |
91 | 91 |
#elif defined LEMON_ASSERT_CUSTOM |
92 | 92 |
# undef LEMON_ASSERT_HANDLER |
93 | 93 |
# ifndef LEMON_CUSTOM_ASSERT_HANDLER |
94 | 94 |
# error "LEMON_CUSTOM_ASSERT_HANDLER is not set" |
95 | 95 |
# endif |
96 | 96 |
# define LEMON_ASSERT_HANDLER LEMON_CUSTOM_ASSERT_HANDLER |
97 | 97 |
#elif defined LEMON_DISABLE_ASSERTS |
98 | 98 |
# undef LEMON_ASSERT_HANDLER |
99 | 99 |
#elif defined NDEBUG |
100 | 100 |
# undef LEMON_ASSERT_HANDLER |
101 | 101 |
#else |
102 | 102 |
# define LEMON_ASSERT_HANDLER ::lemon::assert_fail_abort |
103 | 103 |
#endif |
104 | 104 |
|
105 | 105 |
#ifndef LEMON_FUNCTION_NAME |
106 | 106 |
# if defined __GNUC__ |
107 | 107 |
# define LEMON_FUNCTION_NAME (__PRETTY_FUNCTION__) |
108 | 108 |
# elif defined _MSC_VER |
109 | 109 |
# define LEMON_FUNCTION_NAME (__FUNCSIG__) |
110 |
# elif __STDC_VERSION__ >= 199901L |
|
111 |
# define LEMON_FUNCTION_NAME (__func__) |
|
110 | 112 |
# else |
111 |
# define LEMON_FUNCTION_NAME ( |
|
113 |
# define LEMON_FUNCTION_NAME ("<unknown>") |
|
112 | 114 |
# endif |
113 | 115 |
#endif |
114 | 116 |
|
115 | 117 |
#ifdef DOXYGEN |
116 | 118 |
|
117 | 119 |
/// \ingroup exceptions |
118 | 120 |
/// |
119 | 121 |
/// \brief Macro for assertion with customizable message |
120 | 122 |
/// |
121 | 123 |
/// Macro for assertion with customizable message. \param exp An |
122 | 124 |
/// expression that must be convertible to \c bool. If it is \c |
123 | 125 |
/// false, then an assertion is raised. The concrete behaviour depends |
124 | 126 |
/// on the settings of the assertion system. \param msg A <tt>const |
125 | 127 |
/// char*</tt> parameter, which can be used to provide information |
126 | 128 |
/// about the circumstances of the failed assertion. |
127 | 129 |
/// |
128 | 130 |
/// The assertions are enabled in the default behaviour. |
129 | 131 |
/// You can disable them with the following code: |
130 | 132 |
/// \code |
131 | 133 |
/// #define LEMON_DISABLE_ASSERTS |
132 | 134 |
/// \endcode |
133 | 135 |
/// or with compilation parameters: |
134 | 136 |
/// \code |
135 | 137 |
/// g++ -DLEMON_DISABLE_ASSERTS |
0 comments (0 inline)