]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
macro: add 21st case for IN_SET
authorMike Yuan <me@yhndnzj.com>
Sun, 19 Oct 2025 23:03:12 +0000 (01:03 +0200)
committerMike Yuan <me@yhndnzj.com>
Tue, 4 Nov 2025 11:17:33 +0000 (12:17 +0100)
src/fundamental/macro-fundamental.h

index ba2551cd9ebaf983b955ff13bcb4cf1f5d261614..8fc23c5e6a1eb0977b22db10e2065b45e2328535 100644 (file)
@@ -350,11 +350,12 @@ assert_cc(sizeof(long long) == sizeof(intmax_t));
 #define CASE_F_18(X, ...) case X: CASE_F_17( __VA_ARGS__)
 #define CASE_F_19(X, ...) case X: CASE_F_18( __VA_ARGS__)
 #define CASE_F_20(X, ...) case X: CASE_F_19( __VA_ARGS__)
+#define CASE_F_21(X, ...) case X: CASE_F_20( __VA_ARGS__)
 
-#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
+#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,NAME,...) NAME
 #define FOR_EACH_MAKE_CASE(...) \
-        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
-                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
+        GET_CASE_F(__VA_ARGS__,CASE_F_21,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12, \
+                               CASE_F_11,CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
                    (__VA_ARGS__)
 
 #define IN_SET(x, first, ...)                                           \
@@ -363,7 +364,7 @@ assert_cc(sizeof(long long) == sizeof(intmax_t));
                 /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
                  * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
                 static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
-                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
+                assert_cc(ELEMENTSOF(__assert_in_set) <= 21);           \
                 switch (x) {                                            \
                 FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
                         _found = true;                                  \