diff options
author | Ciprian Barbu <ciprian.barbu@linaro.org> | 2014-10-06 13:23:19 +0300 |
---|---|---|
committer | Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> | 2014-10-09 17:23:46 +0530 |
commit | 8073f6ac4752725614c6b2c8b76298e6f16b893d (patch) | |
tree | 0720221df1491cddbb47824e975dd66f3176b784 /platform/linux-dpdk/include | |
parent | 7d0090a443072ed354cc9e1cd81d16aacb26d64a (diff) |
linux-dpdk: Add ODP_ABORT
Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
Reviewed-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
Signed-off-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
Diffstat (limited to 'platform/linux-dpdk/include')
-rw-r--r-- | platform/linux-dpdk/include/api/odp_debug.h (renamed from platform/linux-dpdk/include/odp_debug.h) | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/platform/linux-dpdk/include/odp_debug.h b/platform/linux-dpdk/include/api/odp_debug.h index 489a22ecb..6b145b505 100644 --- a/platform/linux-dpdk/include/odp_debug.h +++ b/platform/linux-dpdk/include/api/odp_debug.h @@ -13,6 +13,7 @@ #define ODP_DEBUG_H_ #include <stdio.h> +#include <stdlib.h> #ifdef __cplusplus extern "C" { @@ -65,8 +66,19 @@ extern "C" { * Print output to stderr (file, line and function). */ #define ODP_ERR(fmt, ...) \ - fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \ - __LINE__, __func__, ##__VA_ARGS__) +do { fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \ + __LINE__, __func__, ##__VA_ARGS__); \ +} while (0) + +/** + * Print output to stderr (file, line and function), + * then abort. + */ +#define ODP_ABORT(fmt, ...) \ +do { fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \ + __LINE__, __func__, ##__VA_ARGS__); \ + abort(); \ +} while (0) #ifdef __cplusplus } |