qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/3] compiler: extend QEMU_GENERIC to handle more ar


From: Marc-André Lureau
Subject: [Qemu-devel] [PATCH 1/3] compiler: extend QEMU_GENERIC to handle more arguments
Date: Wed, 21 Mar 2018 14:40:03 +0100

The following patch is going to use more than 10 arguments to
QEMU_GENERIC.

Signed-off-by: Marc-André Lureau <address@hidden>
---
 include/qemu/compiler.h | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 9f762695d1..1c11f10ebb 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -129,12 +129,17 @@
  */
 
 /* First, find out the number of generic cases.  */
-#define QEMU_GENERIC(x, ...) \
-    QEMU_GENERIC_(typeof(x), __VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
+#define QEMU_GENERIC(x, ...)                                \
+    QEMU_GENERIC_(typeof(x), __VA_ARGS__,                   \
+                  20, 19, 18, 17, 16, 15, 14, 13, 12, 11,   \
+                  10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
 
 /* There will be extra arguments, but they are not used.  */
-#define QEMU_GENERIC_(x, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, count, ...) \
-    QEMU_GENERIC##count(x, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)
+#define QEMU_GENERIC_(x, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,        \
+                      a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, \
+                      count, ...)                                       \
+    QEMU_GENERIC##count(x, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,      \
+                        a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)
 
 /* Two more helper macros, this time to extract items from a parenthesized
  * list.
@@ -159,5 +164,15 @@
 #define QEMU_GENERIC8(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC7(x, 
__VA_ARGS__))
 #define QEMU_GENERIC9(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC8(x, 
__VA_ARGS__))
 #define QEMU_GENERIC10(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC9(x, 
__VA_ARGS__))
+#define QEMU_GENERIC11(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC10(x, 
__VA_ARGS__))
+#define QEMU_GENERIC12(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC11(x, 
__VA_ARGS__))
+#define QEMU_GENERIC13(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC12(x, 
__VA_ARGS__))
+#define QEMU_GENERIC14(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC13(x, 
__VA_ARGS__))
+#define QEMU_GENERIC15(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC14(x, 
__VA_ARGS__))
+#define QEMU_GENERIC16(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC15(x, 
__VA_ARGS__))
+#define QEMU_GENERIC17(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC16(x, 
__VA_ARGS__))
+#define QEMU_GENERIC18(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC17(x, 
__VA_ARGS__))
+#define QEMU_GENERIC19(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC18(x, 
__VA_ARGS__))
+#define QEMU_GENERIC20(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC19(x, 
__VA_ARGS__))
 
 #endif /* COMPILER_H */
-- 
2.16.2.521.g9aa15f885a




reply via email to

[Prev in Thread] Current Thread [Next in Thread]