summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2012-08-10 19:13:56 +0200
committerPali Rohár <pali.rohar@gmail.com>2012-08-10 19:13:56 +0200
commita67a16479c3223629463646680f29d9285ec54ee (patch)
treeae5bf65ea10a628908a90454c90dda3f1106381e
parent24f34d2f55588eca45a60e3c43dae40434a03c46 (diff)
download0xFFFF-a67a16479c3223629463646680f29d9285ec54ee.tar.bz2
global: Added macro ERROR_RETURN
-rw-r--r--src/global.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/global.h b/src/global.h
index 6e4e866..f2cab07 100644
--- a/src/global.h
+++ b/src/global.h
@@ -16,6 +16,7 @@ extern int verbose;
#define ERROR_STR(str, ...) do { errno = 0; ERROR_INFO_STR(str, __VA_ARGS__); } while (0)
#define ERROR_INFO(...) do { ERROR_INFO_STR("", __VA_ARGS__); } while (0)
#define ERROR(...) do { ERROR_STR("", __VA_ARGS__); } while (0)
+#define ERROR_RETURN(str, ...) do { ERROR("%s", str); return __VA_ARGS__; } while (0)
#define ALLOC_ERROR() do { ERROR("Cannot allocate memory"); } while (0)
#define ALLOC_ERROR_RETURN(...) do { ALLOC_ERROR(); return __VA_ARGS__; } while (0)