|
24 | 24 | * \param env a JNIEnv pointer, used to check for exceptions. |
25 | 25 | * \param error_statement statement executed if an exception has happened. |
26 | 26 | */ |
27 | | -#define RCLJAVA_COMMON_EXCEPTION_CHECK_X(env, error_statement) \ |
| 27 | +#define RCLJAVA_COMMON_CHECK_FOR_EXCEPTION_WITH_ERROR_STATEMENT(env, error_statement) \ |
28 | 28 | do { \ |
29 | 29 | if (env->ExceptionCheck()) { \ |
30 | 30 | error_statement; \ |
|
35 | 35 | /** |
36 | 36 | * \param env a JNIEnv pointer, used to check for exceptions. |
37 | 37 | */ |
38 | | -#define RCLJAVA_COMMON_EXCEPTION_CHECK(env) RCLJAVA_COMMON_EXCEPTION_CHECK_X(env, return ) |
| 38 | +#define RCLJAVA_COMMON_CHECK_FOR_EXCEPTION(env) RCLJAVA_COMMON_CHECK_FOR_EXCEPTION_WITH_STATEMENT(env, return ) |
39 | 39 |
|
40 | 40 | /// Call \ref rcljava_throw_rclexception if \a ret is not RCL_RET_OK, |
41 | 41 | /// and execute \a error_statement in that case. |
|
49 | 49 | * \a base_message can be either a `const char *` or as `std::string`. |
50 | 50 | * \param error_statement statement executed if ret was not RCL_RET_OK. |
51 | 51 | */ |
52 | | -#define RCLJAVA_COMMON_THROW_FROM_RCL_X(env, ret, base_message, error_statement) \ |
| 52 | +#define RCLJAVA_COMMON_THROW_FROM_RCL_WITH_ERROR_STATEMENT(env, ret, base_message, error_statement) \ |
53 | 53 | do { \ |
54 | 54 | if (RCL_RET_OK != ret) { \ |
55 | 55 | rcljava_common::exceptions::rcljava_throw_rclexception( \ |
|
66 | 66 | * \param base_message error message that will be passed to the thrown exception. |
67 | 67 | */ |
68 | 68 | #define RCLJAVA_COMMON_THROW_FROM_RCL(env, ret, base_message) \ |
69 | | - RCLJAVA_COMMON_THROW_FROM_RCL_X(env, ret, base_message, return ) |
| 69 | + RCLJAVA_COMMON_THROW_FROM_RCL_WITH_ERROR_STATEMENT(env, ret, base_message, return ) |
70 | 70 |
|
71 | 71 | namespace rcljava_common |
72 | 72 | { |
|
0 commit comments