This is an automated email from the ASF dual-hosted git repository.

pnoltes pushed a commit to branch feature/celix_err
in repository https://gitbox.apache.org/repos/asf/celix.git

commit 054436002d7386bd8524b2356a83bfec88f5a8f8
Author: Pepijn Noltes <[email protected]>
AuthorDate: Mon May 1 19:18:34 2023 +0200

    Add CELIX_GOTO_IF_ERR marcro to celix_errno.h
---
 libs/utils/include/celix_errno.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libs/utils/include/celix_errno.h b/libs/utils/include/celix_errno.h
index 8a3dbf02..9e5e92b2 100644
--- a/libs/utils/include/celix_errno.h
+++ b/libs/utils/include/celix_errno.h
@@ -52,6 +52,12 @@ extern "C" {
  */
 #define CELIX_DO_IF(status, expr) ((status) == CELIX_SUCCESS) ? (expr) : 
(status)
 
+/*!
+ * Helper macro which check the current status and executes a goto the 
provided label if the
+ * status is not CELIX_SUCCESS (0)
+ */
+#define CELIX_GOTO_IF_ERR(status, label) if ((status) != CELIX_SUCCESS) { goto 
label; }
+
 /*!
  * \defgroup celix_errno Error Codes
  * \ingroup framework

Reply via email to