1 | /* |
2 | * se_util.hpp |
3 | * |
4 | * Created on: Oct 22, 2015 |
5 | * Author: i-bird |
6 | */ |
7 | |
8 | #ifndef OPENFPM_DATA_SRC_UTIL_SE_UTIL_HPP_ |
9 | #define OPENFPM_DATA_SRC_UTIL_SE_UTIL_HPP_ |
10 | |
11 | #include "print_stack.hpp" |
12 | |
13 | // Macro that decide what to do in case of error |
14 | #ifdef STOP_ON_ERROR |
15 | #define ACTION_ON_ERROR(error) print_stack();abort(); |
16 | #define THROW noexcept(true) |
17 | #elif defined(THROW_ON_ERROR) |
18 | #define ACTION_ON_ERROR(error) if (!std::uncaught_exception()) {print_stack();throw error;} |
19 | #define THROW noexcept(false) |
20 | #else |
21 | #define ACTION_ON_ERROR(error) print_stack(); |
22 | #define THROW noexcept(true) |
23 | #endif |
24 | |
25 | |
26 | #endif /* OPENFPM_DATA_SRC_UTIL_SE_UTIL_HPP_ */ |
27 | |