[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UNIKRAFT PATCH] include: Move UK_NARGS into essentials.h



This macro counts the number of arguments passed into a macro and
is useful outside of the ukdebug library.

Signed-off-by: Alexander Jung <alexander.jung@xxxxxxxxx>
---
 include/uk/essentials.h        | 5 +++++
 lib/ukdebug/include/uk/trace.h | 3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/uk/essentials.h b/include/uk/essentials.h
index 6989c97..6bcee2e 100644
--- a/include/uk/essentials.h
+++ b/include/uk/essentials.h
@@ -291,6 +291,11 @@ extern "C" {
        char __assert_ ## y [(x) ? 1 : -1]
 #endif /* UK_CTASSERT */
 
+#ifndef UK_NARGS
+#define __UK_NARGS_X(a, b, c, d, e, f, g, h, n, ...) n
+#define UK_NARGS(...)  __UK_NARGS_X(, ##__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1, 0)
+#endif /* UK_NARGS */
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/ukdebug/include/uk/trace.h b/lib/ukdebug/include/uk/trace.h
index 8745382..bc8da43 100644
--- a/lib/ukdebug/include/uk/trace.h
+++ b/lib/ukdebug/include/uk/trace.h
@@ -66,9 +66,6 @@ struct uk_tracepoint_header {
 extern size_t uk_trace_buffer_free;
 extern char *uk_trace_buffer_writep;
 
-#define __UK_NARGS_X(a, b, c, d, e, f, g, h, n, ...) n
-#define UK_NARGS(...)  __UK_NARGS_X(, ##__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1, 0)
-
 
 static inline void __uk_trace_save_arg(char **pbuff,
                                      size_t *pfree,
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.