diff options
author | Mike Holmes <mike.holmes@linaro.org> | 2014-09-29 14:39:46 -0400 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-09-30 17:32:53 +0400 |
commit | 32e78e10572fb411e9369dfeef0e6daab8bff90a (patch) | |
tree | 8fc069bc5c602e7677871d2a8a5c812a886cdaf0 /platform/linux-generic/include/api/odp_debug.h | |
parent | d8ca83cab037cac1b0f80b029edff9d51ad14932 (diff) |
Add ODP_ABORT
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/include/api/odp_debug.h')
-rw-r--r-- | platform/linux-generic/include/api/odp_debug.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/platform/linux-generic/include/api/odp_debug.h b/platform/linux-generic/include/api/odp_debug.h index e8f600368..344b0a937 100644 --- a/platform/linux-generic/include/api/odp_debug.h +++ b/platform/linux-generic/include/api/odp_debug.h @@ -13,6 +13,7 @@ #define ODP_DEBUG_H_ #include <stdio.h> +#include <stdlib.h> #ifdef __cplusplus extern "C" { @@ -76,8 +77,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 } |