#include <cstdlib>#include <iostream>#include <csignal>

Go to the source code of this file.
Defines | |
| #define | BREAKPOINT() |
| #define | WES_HALT() abort() |
| #define | ERROR_LOG(a) |
| #define | ASSERT_LOG(a, b) if (!(a)) { ERROR_LOG(b); } else (void)0 |
| #define | FATAL_ERROR ERROR_LOG("FATAL ERROR") |
| #define | UNREACHABLE_CODE ERROR_LOG("REACHED UNREACHABLE CODE") |
| Marker for code that should be unreachable. | |
| #define | ASSERT_OP(a, op, b) ASSERT_LOG((a) op (b), #a " " #op " " #b " (" << (a) << " " #op " " << (b) << ")") |
| #define | ASSERT_EQ(a, b) ASSERT_OP(a,==,b) |
| #define | ASSERT_NE(a, b) ASSERT_OP(a,!=,b) |
| #define | ASSERT_GE(a, b) ASSERT_OP(a,>=,b) |
| #define | ASSERT_LE(a, b) ASSERT_OP(a,<=,b) |
| #define | ASSERT_GT(a, b) ASSERT_OP(a,>,b) |
| #define | ASSERT_LT(a, b) ASSERT_OP(a,<,b) |
| #define ASSERT_EQ | ( | a, | ||
| b | ||||
| ) | ASSERT_OP(a,==,b) |
Definition at line 67 of file asserts.hpp.
| #define ASSERT_GE | ( | a, | ||
| b | ||||
| ) | ASSERT_OP(a,>=,b) |
Definition at line 69 of file asserts.hpp.
| #define ASSERT_GT | ( | a, | ||
| b | ||||
| ) | ASSERT_OP(a,>,b) |
Definition at line 71 of file asserts.hpp.
| #define ASSERT_LE | ( | a, | ||
| b | ||||
| ) | ASSERT_OP(a,<=,b) |
Definition at line 70 of file asserts.hpp.
| #define ASSERT_LOG | ( | a, | ||
| b | ||||
| ) | if (!(a)) { ERROR_LOG(b); } else (void)0 |
Definition at line 50 of file asserts.hpp.
Referenced by storyscreen::controller::controller(), storyscreen::part_ui::prepare_background(), and storyscreen::controller::show().
| #define ASSERT_LT | ( | a, | ||
| b | ||||
| ) | ASSERT_OP(a,<,b) |
Definition at line 72 of file asserts.hpp.
| #define ASSERT_NE | ( | a, | ||
| b | ||||
| ) | ASSERT_OP(a,!=,b) |
Definition at line 68 of file asserts.hpp.
| #define ASSERT_OP | ( | a, | ||
| op, | ||||
| b | ||||
| ) | ASSERT_LOG((a) op (b), #a " " #op " " #b " (" << (a) << " " #op " " << (b) << ")") |
Definition at line 62 of file asserts.hpp.
| #define BREAKPOINT | ( | ) |
Definition at line 39 of file asserts.hpp.
| #define ERROR_LOG | ( | a | ) |
do { \ std::cerr << __FILE__ << ":" << __LINE__ << " ASSSERTION FAILED: " << a << std::endl; \ WES_HALT(); \ } while (false)
Definition at line 43 of file asserts.hpp.
Referenced by gui2::policy::placement::tmatrix::calculate_best_size(), gui2::policy::placement::tmatrix::create_item(), gui2::policy::placement::tmatrix::find_at(), gui2::tgenerator< minimum_selection, maximum_selection, placement, select_action >::get_selected_item(), gui2::policy::placement::tmatrix::handle_key_down_arrow(), gui2::policy::placement::tmatrix::handle_key_left_arrow(), gui2::policy::placement::tmatrix::handle_key_right_arrow(), gui2::policy::placement::tmatrix::handle_key_up_arrow(), gui2::policy::placement::tmatrix::place(), gui2::policy::placement::tmatrix::set_origin(), and gui2::policy::placement::tmatrix::set_visible_area().
| #define FATAL_ERROR ERROR_LOG("FATAL ERROR") |
Definition at line 52 of file asserts.hpp.
| #define UNREACHABLE_CODE ERROR_LOG("REACHED UNREACHABLE CODE") |
Marker for code that should be unreachable.
This can be used to avoid compiler warnings and to detect logic errors in the code.
Definition at line 59 of file asserts.hpp.
| #define WES_HALT | ( | ) | abort() |
Definition at line 40 of file asserts.hpp.
| Generated by doxygen 1.7.1 on Wed May 23 2012 01:03:41 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |