From b862963a95060c0b9d7277b7b2dc1386a8dbd6cf Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Tue, 4 Feb 2025 11:14:59 +0100 Subject: [PATCH] Add macro to check result of dec lib functions and return with a failure --- openair2/E1AP/lib/e1ap_lib_common.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openair2/E1AP/lib/e1ap_lib_common.h b/openair2/E1AP/lib/e1ap_lib_common.h index be11100d90..39e3d64448 100644 --- a/openair2/E1AP/lib/e1ap_lib_common.h +++ b/openair2/E1AP/lib/e1ap_lib_common.h @@ -34,6 +34,14 @@ #define PRINT_ERROR(...) // Do nothing #endif +#define CHECK_E1AP_DEC(exp) \ + do { \ + if (!(exp)) { \ + PRINT_ERROR("Failed executing " #exp " in %s() line %d\n", __func__, __LINE__); \ + return false; \ + } \ + } while (0) + #define _E1_EQ_CHECK_GENERIC(condition, fmt, ...) \ do { \ if (!(condition)) { \