summaryrefslogtreecommitdiffstats
path: root/src/defs.h
diff options
context:
space:
mode:
authorGravatar Gediminas Jakutis <gediminas@varciai.lt> 2020-03-02 21:42:46 +0200
committerGravatar Gediminas Jakutis <gediminas@varciai.lt> 2020-03-02 21:42:46 +0200
commit9eb76eda865dc4f82fd53223e5c557f707b569b9 (patch)
tree6afe8364dd57c0f00a550c6ab7ef80383748b8c8 /src/defs.h
parentb6fe7f8d9ade5e1b665bcf2cddb145fd2e0fde57 (diff)
downloadalgos-ld1-9eb76eda865dc4f82fd53223e5c557f707b569b9.tar.gz
algos-ld1-9eb76eda865dc4f82fd53223e5c557f707b569b9.tar.bz2
algos-ld1-9eb76eda865dc4f82fd53223e5c557f707b569b9.zip
begin macrofy error testing.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src/defs.h')
-rw-r--r--src/defs.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/defs.h b/src/defs.h
index e6f1823..1ad2d72 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -5,6 +5,17 @@
#include <stdint.h>
#include <sys/types.h>
+#define try_s(a,l) do {\
+ if(a) {\
+ goto l;\
+ }} while (0);
+
+#define try(a,l,e) do {\
+ if(a) {\
+ ret = e;\
+ goto l;\
+ }} while (0);
+
/* for array implementation */
struct entry {
uint64_t val;