aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic
diff options
context:
space:
mode:
authorMike Holmes <mike.holmes@linaro.org>2014-12-08 16:02:30 -0500
committerMaxim Uvarov <maxim.uvarov@linaro.org>2014-12-10 17:27:56 +0300
commit4440cfe486118c74dc5ebddb24352e6bf1de6af2 (patch)
tree3d14f03c2141ef8d37356322e48716704e3ef764 /platform/linux-generic
parentd1575709ce4e4ab70b31235737d45d0186b3e975 (diff)
api: odp_debug.h: move macros internally
Move the macros that are not used in the API internally: ODP_LOG ODP_PRINT ODP_ASSERT ODP_DEPRICATED ODP_UNUSED Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Ciprian Barbu <ciprian.barbu@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic')
-rw-r--r--platform/linux-generic/include/api/odp_debug.h36
-rw-r--r--platform/linux-generic/include/odp_debug_internal.h50
-rw-r--r--platform/linux-generic/odp_buffer.c1
3 files changed, 50 insertions, 37 deletions
diff --git a/platform/linux-generic/include/api/odp_debug.h b/platform/linux-generic/include/api/odp_debug.h
index cb2c3e922..f5e682185 100644
--- a/platform/linux-generic/include/api/odp_debug.h
+++ b/platform/linux-generic/include/api/odp_debug.h
@@ -12,9 +12,6 @@
#ifndef ODP_DEBUG_H_
#define ODP_DEBUG_H_
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
@@ -27,15 +24,6 @@ extern "C" {
#ifdef __GNUC__
-/**
- * Indicate deprecated variables, functions or types
- */
-#define ODP_DEPRECATED __attribute__((__deprecated__))
-
-/**
- * Intentionally unused variables ot functions
- */
-#define ODP_UNUSED __attribute__((__unused__))
#if __GNUC__ < 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ < 6))
@@ -48,21 +36,10 @@ extern "C" {
#endif
-#else
-#define ODP_DEPRECATED
-#define ODP_UNUSED
#endif
-/**
- * Runtime assertion-macro - aborts if 'cond' is false.
- */
-#define ODP_ASSERT(cond, msg) \
- do { if ((ODP_DEBUG == 1) && (!(cond))) { \
- ODP_ERR("%s\n", msg); \
- abort(); } \
- } while (0)
/**
* Compile time assertion-macro - fail compilation if cond is false.
@@ -98,19 +75,6 @@ typedef enum odp_log_level {
*/
extern int odp_override_log(odp_log_level_e level, const char *fmt, ...);
-/**
- * ODP LOG macro.
- */
-#define ODP_LOG(level, fmt, ...) \
- odp_override_log(level, "%s:%d:%s():" fmt, __FILE__, \
- __LINE__, __func__, ##__VA_ARGS__)
-
-/**
- * Log print message when the application calls one of the ODP APIs
- * specifically for dumping internal data.
- */
-#define ODP_PRINT(fmt, ...) \
- odp_override_log(ODP_LOG_PRINT, " " fmt, ##__VA_ARGS__)
/**
diff --git a/platform/linux-generic/include/odp_debug_internal.h b/platform/linux-generic/include/odp_debug_internal.h
index 647ebde56..f6180d1eb 100644
--- a/platform/linux-generic/include/odp_debug_internal.h
+++ b/platform/linux-generic/include/odp_debug_internal.h
@@ -16,11 +16,45 @@
#ifndef ODP_DEBUG_INTERNAL_H_
#define ODP_DEBUG_INTERNAL_H_
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <odp_debug.h>
#ifdef __cplusplus
extern "C" {
#endif
-#include <odp_debug.h>
+/** @addtogroup odp_ver_abt_log_dbg
+ * @{
+ */
+
+#ifdef __GNUC__
+
+/**
+ * Indicate deprecated variables, functions or types
+ */
+#define ODP_DEPRECATED __attribute__((__deprecated__))
+
+/**
+ * Intentionally unused variables ot functions
+ */
+#define ODP_UNUSED __attribute__((__unused__))
+
+#else
+
+#define ODP_DEPRECATED
+#define ODP_UNUSED
+
+#endif
+
+/**
+ * Runtime assertion-macro - aborts if 'cond' is false.
+ */
+#define ODP_ASSERT(cond, msg) \
+ do { if ((ODP_DEBUG == 1) && (!(cond))) { \
+ ODP_ERR("%s\n", msg); \
+ abort(); } \
+ } while (0)
/**
* This macro is used to indicate when a given function is not implemented
@@ -54,6 +88,20 @@ extern "C" {
abort(); \
} while (0)
+/**
+ * ODP LOG macro.
+ */
+#define ODP_LOG(level, fmt, ...) \
+ odp_override_log(level, "%s:%d:%s():" fmt, __FILE__, \
+ __LINE__, __func__, ##__VA_ARGS__)
+
+/**
+ * Log print message when the application calls one of the ODP APIs
+ * specifically for dumping internal data.
+ */
+#define ODP_PRINT(fmt, ...) \
+ odp_override_log(ODP_LOG_PRINT, " " fmt, ##__VA_ARGS__)
+
#ifdef __cplusplus
}
#endif
diff --git a/platform/linux-generic/odp_buffer.c b/platform/linux-generic/odp_buffer.c
index bcbb99ac8..df68aa9e9 100644
--- a/platform/linux-generic/odp_buffer.c
+++ b/platform/linux-generic/odp_buffer.c
@@ -7,6 +7,7 @@
#include <odp_buffer.h>
#include <odp_buffer_internal.h>
#include <odp_buffer_pool_internal.h>
+#include <odp_debug_internal.h>
#include <string.h>
#include <stdio.h>