From 87fb71d7693fb6b5d2164a1b2a4e964411b05bb0 Mon Sep 17 00:00:00 2001 From: icex2 Date: Thu, 15 Aug 2024 11:34:31 +0200 Subject: [PATCH] feat: Add missing macro to check for errors Other parts of core have this already, align as these are useful to make the code more readable. --- src/api/core/config.h | 3 +++ src/api/core/thread.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/api/core/config.h b/src/api/core/config.h index f780c8d..7b65e8a 100644 --- a/src/api/core/config.h +++ b/src/api/core/config.h @@ -7,6 +7,9 @@ typedef struct bt_core_config bt_core_config_t; +#define BT_CORE_CONFIG_RESULT_IS_ERROR(x) \ + (x > BT_CORE_CONFIG_RESULT_SUCCESS) + typedef enum bt_core_config_result { BT_CORE_CONFIG_RESULT_SUCCESS = 0, BT_CORE_CONFIG_RESULT_ERROR_INTERNAL = 1, diff --git a/src/api/core/thread.h b/src/api/core/thread.h index bbd77b5..1ab5d83 100644 --- a/src/api/core/thread.h +++ b/src/api/core/thread.h @@ -3,6 +3,9 @@ #include +#define BT_CORE_THREAD_RESULT_IS_ERROR(x) \ + (x > BT_CORE_THREAD_RESULT_SUCCESS) + typedef enum bt_core_thread_result { BT_CORE_THREAD_RESULT_SUCCESS = 0, BT_CORE_THREAD_RESULT_ERROR_INTERNAL = 1,