[hipl-dev] [Branch ~hipl-core/hipl/ecc] Rev 5276: Definition of new macro HIP_EAE().

  • From: noreply@xxxxxxxxxxxxx
  • To: HIPL core team <hipl-dev@xxxxxxxxxxxxx>
  • Date: Sat, 08 Jan 2011 14:18:33 -0000

------------------------------------------------------------
revno: 5276
committer: Henrik Ziegeldorf <henrik.ziegeldorf@xxxxxxxxxxxxxx>
branch nick: ecc
timestamp: Sat 2011-01-08 15:14:53 +0100
message:
  Definition of new macro HIP_EAE(). 
  
  This macro should be used whenever one wants to exit a function with a error 
code and error method.
  This macro should replace HIP_IFEL(1, err, errmsg) constructs.
modified:
  lib/core/ife.h


--
lp:~hipl-core/hipl/ecc
https://code.launchpad.net/~hipl-core/hipl/ecc

Your team HIPL core team is subscribed to branch lp:~hipl-core/hipl/ecc.
To unsubscribe from this branch go to 
https://code.launchpad.net/~hipl-core/hipl/ecc/+edit-subscription
=== modified file 'lib/core/ife.h'
--- lib/core/ife.h      2010-11-30 10:53:14 +0000
+++ lib/core/ife.h      2011-01-08 14:14:53 +0000
@@ -41,6 +41,23 @@
  */
 
 /**
+ * Use this macro to exit a function and output an error message.
+ * Variable 'err' must be defined, usually type int.
+ * Label 'out_err' must be defined, on errors this label is used
+ * as destination after proper actions.
+ *
+ * @param eval Set variable called 'err' to this value.
+ *
+ * @note EAE stands for ERROR and EXIT.
+ */
+#define HIP_EAE(eval, args ...) \
+    { \
+        HIP_ERROR(args); \
+        err = eval; \
+        goto out_err; \
+    }
+
+/**
  * Use this macro to detect failures and exit function in case
  * of such. Variable 'err' must be defined, usually type int.
  * Label 'out_err' must be defined, on errors this label is used

Other related posts: