diff --git a/include/sys/util_internal.h b/include/sys/util_internal.h index c272fd0b25f8b6..163048b4f6413c 100644 --- a/include/sys/util_internal.h +++ b/include/sys/util_internal.h @@ -15,6 +15,8 @@ #ifndef ZEPHYR_INCLUDE_SYS_UTIL_INTERNAL_H_ #define ZEPHYR_INCLUDE_SYS_UTIL_INTERNAL_H_ +#include "util_loops.h" + /* IS_ENABLED() helpers */ /* This is called from IS_ENABLED(), and sticks on a "_XXXX" prefix, @@ -79,567 +81,8 @@ #define Z_LIST_NO_EMPTIES(e) \ COND_CODE_1(IS_EMPTY(e), (), (Z_LIST_ADD_ELEM(e))) -/* - * Macros for doing code-generation with the preprocessor as if we - * could do recursive macro expansion. - * - * Generally it is better to generate code with the preprocessor than - * to copy-paste code or to generate code with the build system / - * python script's etc. - * - * http://stackoverflow.com/a/12540675 - */ - -#define UTIL_EMPTY(...) -#define UTIL_DEFER(...) __VA_ARGS__ UTIL_EMPTY() -#define UTIL_OBSTRUCT(...) __VA_ARGS__ UTIL_DEFER(UTIL_EMPTY)() -#define UTIL_EXPAND(...) __VA_ARGS__ - -#define UTIL_EVAL(...) UTIL_EVAL1(UTIL_EVAL1(UTIL_EVAL1(__VA_ARGS__))) -#define UTIL_EVAL1(...) UTIL_EVAL2(UTIL_EVAL2(UTIL_EVAL2(__VA_ARGS__))) -#define UTIL_EVAL2(...) UTIL_EVAL3(UTIL_EVAL3(UTIL_EVAL3(__VA_ARGS__))) -#define UTIL_EVAL3(...) UTIL_EVAL4(UTIL_EVAL4(UTIL_EVAL4(__VA_ARGS__))) -#define UTIL_EVAL4(...) UTIL_EVAL5(UTIL_EVAL5(UTIL_EVAL5(__VA_ARGS__))) -#define UTIL_EVAL5(...) __VA_ARGS__ - #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__) #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__ - -/* - * UTIL_INC(x) for an integer literal x from 0 to 255 expands to an - * integer literal whose value is x+1. - * - * Similarly, UTIL_DEC(x) is (x-1) as an integer literal. - */ -#define UTIL_INC(x) UTIL_PRIMITIVE_CAT(UTIL_INC_, x) -#define UTIL_DEC(x) UTIL_PRIMITIVE_CAT(UTIL_DEC_, x) - -#define UTIL_INC_0 1 -#define UTIL_INC_1 2 -#define UTIL_INC_2 3 -#define UTIL_INC_3 4 -#define UTIL_INC_4 5 -#define UTIL_INC_5 6 -#define UTIL_INC_6 7 -#define UTIL_INC_7 8 -#define UTIL_INC_8 9 -#define UTIL_INC_9 10 -#define UTIL_INC_10 11 -#define UTIL_INC_11 12 -#define UTIL_INC_12 13 -#define UTIL_INC_13 14 -#define UTIL_INC_14 15 -#define UTIL_INC_15 16 -#define UTIL_INC_16 17 -#define UTIL_INC_17 18 -#define UTIL_INC_18 19 -#define UTIL_INC_19 20 -#define UTIL_INC_20 21 -#define UTIL_INC_21 22 -#define UTIL_INC_22 23 -#define UTIL_INC_23 24 -#define UTIL_INC_24 25 -#define UTIL_INC_25 26 -#define UTIL_INC_26 27 -#define UTIL_INC_27 28 -#define UTIL_INC_28 29 -#define UTIL_INC_29 30 -#define UTIL_INC_30 31 -#define UTIL_INC_31 32 -#define UTIL_INC_32 33 -#define UTIL_INC_33 34 -#define UTIL_INC_34 35 -#define UTIL_INC_35 36 -#define UTIL_INC_36 37 -#define UTIL_INC_37 38 -#define UTIL_INC_38 39 -#define UTIL_INC_39 40 -#define UTIL_INC_40 41 -#define UTIL_INC_41 42 -#define UTIL_INC_42 43 -#define UTIL_INC_43 44 -#define UTIL_INC_44 45 -#define UTIL_INC_45 46 -#define UTIL_INC_46 47 -#define UTIL_INC_47 48 -#define UTIL_INC_48 49 -#define UTIL_INC_49 50 -#define UTIL_INC_50 51 -#define UTIL_INC_51 52 -#define UTIL_INC_52 53 -#define UTIL_INC_53 54 -#define UTIL_INC_54 55 -#define UTIL_INC_55 56 -#define UTIL_INC_56 57 -#define UTIL_INC_57 58 -#define UTIL_INC_58 59 -#define UTIL_INC_59 60 -#define UTIL_INC_50 51 -#define UTIL_INC_51 52 -#define UTIL_INC_52 53 -#define UTIL_INC_53 54 -#define UTIL_INC_54 55 -#define UTIL_INC_55 56 -#define UTIL_INC_56 57 -#define UTIL_INC_57 58 -#define UTIL_INC_58 59 -#define UTIL_INC_59 60 -#define UTIL_INC_60 61 -#define UTIL_INC_61 62 -#define UTIL_INC_62 63 -#define UTIL_INC_63 64 -#define UTIL_INC_64 65 -#define UTIL_INC_65 66 -#define UTIL_INC_66 67 -#define UTIL_INC_67 68 -#define UTIL_INC_68 69 -#define UTIL_INC_69 70 -#define UTIL_INC_70 71 -#define UTIL_INC_71 72 -#define UTIL_INC_72 73 -#define UTIL_INC_73 74 -#define UTIL_INC_74 75 -#define UTIL_INC_75 76 -#define UTIL_INC_76 77 -#define UTIL_INC_77 78 -#define UTIL_INC_78 79 -#define UTIL_INC_79 80 -#define UTIL_INC_80 81 -#define UTIL_INC_81 82 -#define UTIL_INC_82 83 -#define UTIL_INC_83 84 -#define UTIL_INC_84 85 -#define UTIL_INC_85 86 -#define UTIL_INC_86 87 -#define UTIL_INC_87 88 -#define UTIL_INC_88 89 -#define UTIL_INC_89 90 -#define UTIL_INC_90 91 -#define UTIL_INC_91 92 -#define UTIL_INC_92 93 -#define UTIL_INC_93 94 -#define UTIL_INC_94 95 -#define UTIL_INC_95 96 -#define UTIL_INC_96 97 -#define UTIL_INC_97 98 -#define UTIL_INC_98 99 -#define UTIL_INC_99 100 -#define UTIL_INC_100 101 -#define UTIL_INC_101 102 -#define UTIL_INC_102 103 -#define UTIL_INC_103 104 -#define UTIL_INC_104 105 -#define UTIL_INC_105 106 -#define UTIL_INC_106 107 -#define UTIL_INC_107 108 -#define UTIL_INC_108 109 -#define UTIL_INC_109 110 -#define UTIL_INC_110 111 -#define UTIL_INC_111 112 -#define UTIL_INC_112 113 -#define UTIL_INC_113 114 -#define UTIL_INC_114 115 -#define UTIL_INC_115 116 -#define UTIL_INC_116 117 -#define UTIL_INC_117 118 -#define UTIL_INC_118 119 -#define UTIL_INC_119 120 -#define UTIL_INC_120 121 -#define UTIL_INC_121 122 -#define UTIL_INC_122 123 -#define UTIL_INC_123 124 -#define UTIL_INC_124 125 -#define UTIL_INC_125 126 -#define UTIL_INC_126 127 -#define UTIL_INC_127 128 -#define UTIL_INC_128 129 -#define UTIL_INC_129 130 -#define UTIL_INC_130 131 -#define UTIL_INC_131 132 -#define UTIL_INC_132 133 -#define UTIL_INC_133 134 -#define UTIL_INC_134 135 -#define UTIL_INC_135 136 -#define UTIL_INC_136 137 -#define UTIL_INC_137 138 -#define UTIL_INC_138 139 -#define UTIL_INC_139 140 -#define UTIL_INC_140 141 -#define UTIL_INC_141 142 -#define UTIL_INC_142 143 -#define UTIL_INC_143 144 -#define UTIL_INC_144 145 -#define UTIL_INC_145 146 -#define UTIL_INC_146 147 -#define UTIL_INC_147 148 -#define UTIL_INC_148 149 -#define UTIL_INC_149 150 -#define UTIL_INC_150 151 -#define UTIL_INC_151 152 -#define UTIL_INC_152 153 -#define UTIL_INC_153 154 -#define UTIL_INC_154 155 -#define UTIL_INC_155 156 -#define UTIL_INC_156 157 -#define UTIL_INC_157 158 -#define UTIL_INC_158 159 -#define UTIL_INC_159 160 -#define UTIL_INC_160 161 -#define UTIL_INC_161 162 -#define UTIL_INC_162 163 -#define UTIL_INC_163 164 -#define UTIL_INC_164 165 -#define UTIL_INC_165 166 -#define UTIL_INC_166 167 -#define UTIL_INC_167 168 -#define UTIL_INC_168 169 -#define UTIL_INC_169 170 -#define UTIL_INC_170 171 -#define UTIL_INC_171 172 -#define UTIL_INC_172 173 -#define UTIL_INC_173 174 -#define UTIL_INC_174 175 -#define UTIL_INC_175 176 -#define UTIL_INC_176 177 -#define UTIL_INC_177 178 -#define UTIL_INC_178 179 -#define UTIL_INC_179 180 -#define UTIL_INC_180 181 -#define UTIL_INC_181 182 -#define UTIL_INC_182 183 -#define UTIL_INC_183 184 -#define UTIL_INC_184 185 -#define UTIL_INC_185 186 -#define UTIL_INC_186 187 -#define UTIL_INC_187 188 -#define UTIL_INC_188 189 -#define UTIL_INC_189 190 -#define UTIL_INC_190 191 -#define UTIL_INC_191 192 -#define UTIL_INC_192 193 -#define UTIL_INC_193 194 -#define UTIL_INC_194 195 -#define UTIL_INC_195 196 -#define UTIL_INC_196 197 -#define UTIL_INC_197 198 -#define UTIL_INC_198 199 -#define UTIL_INC_199 200 -#define UTIL_INC_200 201 -#define UTIL_INC_201 202 -#define UTIL_INC_202 203 -#define UTIL_INC_203 204 -#define UTIL_INC_204 205 -#define UTIL_INC_205 206 -#define UTIL_INC_206 207 -#define UTIL_INC_207 208 -#define UTIL_INC_208 209 -#define UTIL_INC_209 210 -#define UTIL_INC_210 211 -#define UTIL_INC_211 212 -#define UTIL_INC_212 213 -#define UTIL_INC_213 214 -#define UTIL_INC_214 215 -#define UTIL_INC_215 216 -#define UTIL_INC_216 217 -#define UTIL_INC_217 218 -#define UTIL_INC_218 219 -#define UTIL_INC_219 220 -#define UTIL_INC_220 221 -#define UTIL_INC_221 222 -#define UTIL_INC_222 223 -#define UTIL_INC_223 224 -#define UTIL_INC_224 225 -#define UTIL_INC_225 226 -#define UTIL_INC_226 227 -#define UTIL_INC_227 228 -#define UTIL_INC_228 229 -#define UTIL_INC_229 230 -#define UTIL_INC_230 231 -#define UTIL_INC_231 232 -#define UTIL_INC_232 233 -#define UTIL_INC_233 234 -#define UTIL_INC_234 235 -#define UTIL_INC_235 236 -#define UTIL_INC_236 237 -#define UTIL_INC_237 238 -#define UTIL_INC_238 239 -#define UTIL_INC_239 240 -#define UTIL_INC_240 241 -#define UTIL_INC_241 242 -#define UTIL_INC_242 243 -#define UTIL_INC_243 244 -#define UTIL_INC_244 245 -#define UTIL_INC_245 246 -#define UTIL_INC_246 247 -#define UTIL_INC_247 248 -#define UTIL_INC_248 249 -#define UTIL_INC_249 250 -#define UTIL_INC_250 251 -#define UTIL_INC_251 252 -#define UTIL_INC_252 253 -#define UTIL_INC_253 254 -#define UTIL_INC_254 255 -#define UTIL_INC_255 256 -#define UTIL_INC_256 257 - -#define UTIL_DEC_0 0 -#define UTIL_DEC_1 0 -#define UTIL_DEC_2 1 -#define UTIL_DEC_3 2 -#define UTIL_DEC_4 3 -#define UTIL_DEC_5 4 -#define UTIL_DEC_6 5 -#define UTIL_DEC_7 6 -#define UTIL_DEC_8 7 -#define UTIL_DEC_9 8 -#define UTIL_DEC_10 9 -#define UTIL_DEC_11 10 -#define UTIL_DEC_12 11 -#define UTIL_DEC_13 12 -#define UTIL_DEC_14 13 -#define UTIL_DEC_15 14 -#define UTIL_DEC_16 15 -#define UTIL_DEC_17 16 -#define UTIL_DEC_18 17 -#define UTIL_DEC_19 18 -#define UTIL_DEC_20 19 -#define UTIL_DEC_21 20 -#define UTIL_DEC_22 21 -#define UTIL_DEC_23 22 -#define UTIL_DEC_24 23 -#define UTIL_DEC_25 24 -#define UTIL_DEC_26 25 -#define UTIL_DEC_27 26 -#define UTIL_DEC_28 27 -#define UTIL_DEC_29 28 -#define UTIL_DEC_30 29 -#define UTIL_DEC_31 30 -#define UTIL_DEC_32 31 -#define UTIL_DEC_33 32 -#define UTIL_DEC_34 33 -#define UTIL_DEC_35 34 -#define UTIL_DEC_36 35 -#define UTIL_DEC_37 36 -#define UTIL_DEC_38 37 -#define UTIL_DEC_39 38 -#define UTIL_DEC_40 39 -#define UTIL_DEC_41 40 -#define UTIL_DEC_42 41 -#define UTIL_DEC_43 42 -#define UTIL_DEC_44 43 -#define UTIL_DEC_45 44 -#define UTIL_DEC_46 45 -#define UTIL_DEC_47 46 -#define UTIL_DEC_48 47 -#define UTIL_DEC_49 48 -#define UTIL_DEC_50 49 -#define UTIL_DEC_51 50 -#define UTIL_DEC_52 51 -#define UTIL_DEC_53 52 -#define UTIL_DEC_54 53 -#define UTIL_DEC_55 54 -#define UTIL_DEC_56 55 -#define UTIL_DEC_57 56 -#define UTIL_DEC_58 57 -#define UTIL_DEC_59 58 -#define UTIL_DEC_60 59 -#define UTIL_DEC_61 60 -#define UTIL_DEC_62 61 -#define UTIL_DEC_63 62 -#define UTIL_DEC_64 63 -#define UTIL_DEC_65 64 -#define UTIL_DEC_66 65 -#define UTIL_DEC_67 66 -#define UTIL_DEC_68 67 -#define UTIL_DEC_69 68 -#define UTIL_DEC_70 69 -#define UTIL_DEC_71 70 -#define UTIL_DEC_72 71 -#define UTIL_DEC_73 72 -#define UTIL_DEC_74 73 -#define UTIL_DEC_75 74 -#define UTIL_DEC_76 75 -#define UTIL_DEC_77 76 -#define UTIL_DEC_78 77 -#define UTIL_DEC_79 78 -#define UTIL_DEC_80 79 -#define UTIL_DEC_81 80 -#define UTIL_DEC_82 81 -#define UTIL_DEC_83 82 -#define UTIL_DEC_84 83 -#define UTIL_DEC_85 84 -#define UTIL_DEC_86 85 -#define UTIL_DEC_87 86 -#define UTIL_DEC_88 87 -#define UTIL_DEC_89 88 -#define UTIL_DEC_90 89 -#define UTIL_DEC_91 90 -#define UTIL_DEC_92 91 -#define UTIL_DEC_93 92 -#define UTIL_DEC_94 93 -#define UTIL_DEC_95 94 -#define UTIL_DEC_96 95 -#define UTIL_DEC_97 96 -#define UTIL_DEC_98 97 -#define UTIL_DEC_99 98 -#define UTIL_DEC_100 99 -#define UTIL_DEC_101 100 -#define UTIL_DEC_102 101 -#define UTIL_DEC_103 102 -#define UTIL_DEC_104 103 -#define UTIL_DEC_105 104 -#define UTIL_DEC_106 105 -#define UTIL_DEC_107 106 -#define UTIL_DEC_108 107 -#define UTIL_DEC_109 108 -#define UTIL_DEC_110 109 -#define UTIL_DEC_111 110 -#define UTIL_DEC_112 111 -#define UTIL_DEC_113 112 -#define UTIL_DEC_114 113 -#define UTIL_DEC_115 114 -#define UTIL_DEC_116 115 -#define UTIL_DEC_117 116 -#define UTIL_DEC_118 117 -#define UTIL_DEC_119 118 -#define UTIL_DEC_120 119 -#define UTIL_DEC_121 120 -#define UTIL_DEC_122 121 -#define UTIL_DEC_123 122 -#define UTIL_DEC_124 123 -#define UTIL_DEC_125 124 -#define UTIL_DEC_126 125 -#define UTIL_DEC_127 126 -#define UTIL_DEC_128 127 -#define UTIL_DEC_129 128 -#define UTIL_DEC_130 129 -#define UTIL_DEC_131 130 -#define UTIL_DEC_132 131 -#define UTIL_DEC_133 132 -#define UTIL_DEC_134 133 -#define UTIL_DEC_135 134 -#define UTIL_DEC_136 135 -#define UTIL_DEC_137 136 -#define UTIL_DEC_138 137 -#define UTIL_DEC_139 138 -#define UTIL_DEC_140 139 -#define UTIL_DEC_141 140 -#define UTIL_DEC_142 141 -#define UTIL_DEC_143 142 -#define UTIL_DEC_144 143 -#define UTIL_DEC_145 144 -#define UTIL_DEC_146 145 -#define UTIL_DEC_147 146 -#define UTIL_DEC_148 147 -#define UTIL_DEC_149 148 -#define UTIL_DEC_150 149 -#define UTIL_DEC_151 150 -#define UTIL_DEC_152 151 -#define UTIL_DEC_153 152 -#define UTIL_DEC_154 153 -#define UTIL_DEC_155 154 -#define UTIL_DEC_156 155 -#define UTIL_DEC_157 156 -#define UTIL_DEC_158 157 -#define UTIL_DEC_159 158 -#define UTIL_DEC_160 159 -#define UTIL_DEC_161 160 -#define UTIL_DEC_162 161 -#define UTIL_DEC_163 162 -#define UTIL_DEC_164 163 -#define UTIL_DEC_165 164 -#define UTIL_DEC_166 165 -#define UTIL_DEC_167 166 -#define UTIL_DEC_168 167 -#define UTIL_DEC_169 168 -#define UTIL_DEC_170 169 -#define UTIL_DEC_171 170 -#define UTIL_DEC_172 171 -#define UTIL_DEC_173 172 -#define UTIL_DEC_174 173 -#define UTIL_DEC_175 174 -#define UTIL_DEC_176 175 -#define UTIL_DEC_177 176 -#define UTIL_DEC_178 177 -#define UTIL_DEC_179 178 -#define UTIL_DEC_180 179 -#define UTIL_DEC_181 180 -#define UTIL_DEC_182 181 -#define UTIL_DEC_183 182 -#define UTIL_DEC_184 183 -#define UTIL_DEC_185 184 -#define UTIL_DEC_186 185 -#define UTIL_DEC_187 186 -#define UTIL_DEC_188 187 -#define UTIL_DEC_189 188 -#define UTIL_DEC_190 189 -#define UTIL_DEC_191 190 -#define UTIL_DEC_192 191 -#define UTIL_DEC_193 192 -#define UTIL_DEC_194 193 -#define UTIL_DEC_195 194 -#define UTIL_DEC_196 195 -#define UTIL_DEC_197 196 -#define UTIL_DEC_198 197 -#define UTIL_DEC_199 198 -#define UTIL_DEC_200 199 -#define UTIL_DEC_201 200 -#define UTIL_DEC_202 201 -#define UTIL_DEC_203 202 -#define UTIL_DEC_204 203 -#define UTIL_DEC_205 204 -#define UTIL_DEC_206 205 -#define UTIL_DEC_207 206 -#define UTIL_DEC_208 207 -#define UTIL_DEC_209 208 -#define UTIL_DEC_210 209 -#define UTIL_DEC_211 210 -#define UTIL_DEC_212 211 -#define UTIL_DEC_213 212 -#define UTIL_DEC_214 213 -#define UTIL_DEC_215 214 -#define UTIL_DEC_216 215 -#define UTIL_DEC_217 216 -#define UTIL_DEC_218 217 -#define UTIL_DEC_219 218 -#define UTIL_DEC_220 219 -#define UTIL_DEC_221 220 -#define UTIL_DEC_222 221 -#define UTIL_DEC_223 222 -#define UTIL_DEC_224 223 -#define UTIL_DEC_225 224 -#define UTIL_DEC_226 225 -#define UTIL_DEC_227 226 -#define UTIL_DEC_228 227 -#define UTIL_DEC_229 228 -#define UTIL_DEC_230 229 -#define UTIL_DEC_231 230 -#define UTIL_DEC_232 231 -#define UTIL_DEC_233 232 -#define UTIL_DEC_234 233 -#define UTIL_DEC_235 234 -#define UTIL_DEC_236 235 -#define UTIL_DEC_237 236 -#define UTIL_DEC_238 237 -#define UTIL_DEC_239 238 -#define UTIL_DEC_240 239 -#define UTIL_DEC_241 240 -#define UTIL_DEC_242 241 -#define UTIL_DEC_243 242 -#define UTIL_DEC_244 243 -#define UTIL_DEC_245 244 -#define UTIL_DEC_246 245 -#define UTIL_DEC_247 246 -#define UTIL_DEC_248 247 -#define UTIL_DEC_249 248 -#define UTIL_DEC_250 249 -#define UTIL_DEC_251 250 -#define UTIL_DEC_252 251 -#define UTIL_DEC_253 252 -#define UTIL_DEC_254 253 -#define UTIL_DEC_255 254 -#define UTIL_DEC_256 255 - #define UTIL_CHECK_N(x, n, ...) n #define UTIL_CHECK(...) UTIL_CHECK_N(__VA_ARGS__, 0,) #define UTIL_NOT(x) UTIL_CHECK(UTIL_PRIMITIVE_CAT(UTIL_NOT_, x)) @@ -648,97 +91,9 @@ #define UTIL_COMPL_0 1 #define UTIL_COMPL_1 0 #define UTIL_BOOL(x) UTIL_COMPL(UTIL_NOT(x)) -#define UTIL_IIF(c) UTIL_PRIMITIVE_CAT(UTIL_IIF_, c) -#define UTIL_IIF_0(t, ...) __VA_ARGS__ -#define UTIL_IIF_1(t, ...) t -#define UTIL_IF(c) UTIL_IIF(UTIL_BOOL(c)) - -#define UTIL_EAT(...) -#define UTIL_WHEN(c) UTIL_IF(c)(UTIL_EXPAND, UTIL_EAT) - -#define UTIL_REPEAT(count, macro, ...) \ - UTIL_WHEN(count) \ - ( \ - UTIL_OBSTRUCT(UTIL_REPEAT_INDIRECT) () \ - ( \ - UTIL_DEC(count), macro, __VA_ARGS__ \ - ) \ - UTIL_OBSTRUCT(macro) \ - ( \ - UTIL_DEC(count), __VA_ARGS__ \ - ) \ - ) -#define UTIL_REPEAT_INDIRECT() UTIL_REPEAT - -/* Internal macros used by FOR_EACH, FOR_EACH_IDX, etc. */ - -#define Z_FOR_EACH_IDX(count, n, macro, sep, fixed_arg0, fixed_arg1, ...)\ - UTIL_WHEN(count) \ - ( \ - UTIL_OBSTRUCT(macro) \ - ( \ - fixed_arg0, fixed_arg1, n, Z_GET_ARG1(__VA_ARGS__)\ - ) COND_CODE_1(count, (), (__DEBRACKET sep)) \ - UTIL_OBSTRUCT(Z_FOR_EACH_IDX_INDIRECT) () \ - ( \ - UTIL_DEC(count), UTIL_INC(n), macro, sep, \ - fixed_arg0, fixed_arg1, \ - Z_GET_ARGS_LESS_1(__VA_ARGS__) \ - ) \ - ) - -#define Z_GET_ARG1(arg1, ...) arg1 -#define Z_GET_ARGS_LESS_1(arg1, ...) __VA_ARGS__ - -#define Z_FOR_EACH_IDX_INDIRECT() Z_FOR_EACH_IDX - -#define Z_FOR_EACH_IDX2(count, iter, macro, sc, fixed_arg0, fixed_arg1, ...) \ - UTIL_EVAL(Z_FOR_EACH_IDX(count, iter, macro, sc,\ - fixed_arg0, fixed_arg1, __VA_ARGS__)) - -#define Z_FOR_EACH_SWALLOW_NOTHING(F, fixed_arg, index, arg) \ - F(index, arg, fixed_arg) - -#define Z_FOR_EACH_SWALLOW_FIXED_ARG(F, fixed_arg, index, arg) F(index, arg) - -#define Z_FOR_EACH_SWALLOW_INDEX_FIXED_ARG(F, fixed_arg, index, arg) F(arg) -#define Z_FOR_EACH_SWALLOW_INDEX(F, fixed_arg, index, arg) F(arg, fixed_arg) - -/* This is a workaround to enable mixing GET_ARG_N with FOR_EACH macros. If - * same UTIL_EVAL macro is used then macro is incorrectly resolved. - */ -#define Z_GET_ARG_N_EVAL(...) \ - Z_GET_ARG_N_EVAL1(Z_GET_ARG_N_EVAL1(Z_GET_ARG_N_EVAL1(__VA_ARGS__))) -#define Z_GET_ARG_N_EVAL1(...) \ - Z_GET_ARG_N_EVAL2(Z_GET_ARG_N_EVAL2(Z_GET_ARG_N_EVAL2(__VA_ARGS__))) -#define Z_GET_ARG_N_EVAL2(...) \ - Z_GET_ARG_N_EVAL3(Z_GET_ARG_N_EVAL3(Z_GET_ARG_N_EVAL3(__VA_ARGS__))) -#define Z_GET_ARG_N_EVAL3(...) \ - Z_GET_ARG_N_EVAL4(Z_GET_ARG_N_EVAL4(Z_GET_ARG_N_EVAL4(__VA_ARGS__))) -#define Z_GET_ARG_N_EVAL4(...) \ - Z_GET_ARG_N_EVAL5(Z_GET_ARG_N_EVAL5(Z_GET_ARG_N_EVAL5(__VA_ARGS__))) -#define Z_GET_ARG_N_EVAL5(...) __VA_ARGS__ - -/* Set of internal macros used for GET_ARG_N of macros. */ -#define Z_GET_ARG_N(count, single_arg, ...) \ - UTIL_WHEN(count) \ - ( \ - IF_ENABLED(count, (UTIL_OBSTRUCT(__DEBRACKET) \ - ( \ - COND_CODE_1(single_arg, \ - (Z_GET_ARG1(__VA_ARGS__)), (__VA_ARGS__))\ - ))) \ - UTIL_OBSTRUCT(Z_GET_ARG_N_INDIRECT) () \ - ( \ - UTIL_DEC(count), single_arg, \ - Z_GET_ARGS_LESS_1(__VA_ARGS__) \ - ) \ - ) - -#define Z_GET_ARG_N_INDIRECT() Z_GET_ARG_N -#define _Z_GET_ARG_N(N, single_arg, ...) \ - Z_GET_ARG_N_EVAL(Z_GET_ARG_N(N, single_arg, __VA_ARGS__)) +#define UTIL_EVAL(...) __VA_ARGS__ +#define UTIL_REPEAT(...) UTIL_LISTIFY(__VA_ARGS__) /* Implementation details for NUM_VA_ARGS_LESS_1 */ #define NUM_VA_ARGS_LESS_1_IMPL( \ diff --git a/include/sys/util_loops.h b/include/sys/util_loops.h new file mode 100644 index 00000000000000..7b2e1281ec6a3a --- /dev/null +++ b/include/sys/util_loops.h @@ -0,0 +1,2108 @@ +/* + * Copyright (c) 2021, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file + * @brief Internals for looping macros + * + * Repetitive or obscure helper macros needed by sys/util.h. + */ + +#ifndef ZEPHYR_INCLUDE_SYS_UTIL_LOOPS_H_ +#define ZEPHYR_INCLUDE_SYS_UTIL_LOOPS_H_ + +#define Z_FOR_LOOP_GET_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, \ + _12, _13, _14, _15, _16, _17, _18, _19, _20, \ + _21, _22, _23, _24, _25, _26, _27, _28, _29, \ + _30, _31, _32, _33, _34, _35, _36, _37, _38, \ + _39, _40, _41, _42, _43, _44, _45, _46, _47, \ + _48, _49, _50, _51, _52, _53, _54, _55, _56, \ + _57, _58, _59, _60, _61, _62, _63, _64, N, ...) N + +#define Z_FOR_LOOP_0(z_call, sep, fixed_arg0, fixed_arg1, ...) + +#define Z_FOR_LOOP_1(z_call, sep, fixed_arg0, fixed_arg1, x) \ + z_call(0, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_2(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_1(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(1, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_3(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_2(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(2, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_4(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_3(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(3, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_5(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_4(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(4, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_6(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_5(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(5, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_7(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_6(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(6, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_8(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_7(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(7, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_9(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_8(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(8, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_10(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_9(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(9, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_11(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_10(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(10, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_12(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_11(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(11, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_13(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_12(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(12, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_14(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_13(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(13, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_15(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_14(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(14, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_16(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_15(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(15, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_17(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_16(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(16, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_18(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_17(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(17, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_19(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_18(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(18, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_20(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_19(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(19, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_21(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_20(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(20, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_22(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_21(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(21, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_23(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_22(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(22, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_24(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_23(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(23, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_25(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_24(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(24, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_26(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_25(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(25, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_27(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_26(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(26, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_28(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_27(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(27, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_29(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_28(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(28, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_30(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_29(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(29, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_31(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_30(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(30, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_32(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_31(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(31, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_33(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_32(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(32, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_34(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_33(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(33, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_35(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_34(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(34, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_36(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_35(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(35, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_37(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_36(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(36, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_38(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_37(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(37, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_39(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_38(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(38, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_40(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_39(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(39, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_41(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_40(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(40, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_42(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_41(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(41, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_43(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_42(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(42, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_44(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_43(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(43, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_45(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_44(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(44, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_46(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_45(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(45, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_47(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_46(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(46, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_48(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_47(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(47, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_49(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_48(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(48, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_50(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_49(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(49, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_51(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_50(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(50, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_52(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_51(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(51, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_53(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_52(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(52, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_54(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_53(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(53, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_55(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_54(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(54, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_56(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_55(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(55, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_57(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_56(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(56, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_58(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_57(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(57, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_59(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_58(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(58, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_60(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_59(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(59, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_61(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_60(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(60, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_62(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_61(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(61, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_63(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_62(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(62, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_LOOP_64(z_call, sep, fixed_arg0, fixed_arg1, x, ...) \ + Z_FOR_LOOP_63(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \ + __DEBRACKET sep \ + z_call(63, x, fixed_arg0, fixed_arg1) + +#define Z_FOR_EACH_ENGINE(x, sep, fixed_arg0, fixed_arg1, ...) \ + Z_FOR_LOOP_GET_ARG(__VA_ARGS__, \ + Z_FOR_LOOP_64, \ + Z_FOR_LOOP_63, \ + Z_FOR_LOOP_62, \ + Z_FOR_LOOP_61, \ + Z_FOR_LOOP_60, \ + Z_FOR_LOOP_59, \ + Z_FOR_LOOP_58, \ + Z_FOR_LOOP_57, \ + Z_FOR_LOOP_56, \ + Z_FOR_LOOP_55, \ + Z_FOR_LOOP_54, \ + Z_FOR_LOOP_53, \ + Z_FOR_LOOP_52, \ + Z_FOR_LOOP_51, \ + Z_FOR_LOOP_50, \ + Z_FOR_LOOP_49, \ + Z_FOR_LOOP_48, \ + Z_FOR_LOOP_47, \ + Z_FOR_LOOP_46, \ + Z_FOR_LOOP_45, \ + Z_FOR_LOOP_44, \ + Z_FOR_LOOP_43, \ + Z_FOR_LOOP_42, \ + Z_FOR_LOOP_41, \ + Z_FOR_LOOP_40, \ + Z_FOR_LOOP_39, \ + Z_FOR_LOOP_38, \ + Z_FOR_LOOP_37, \ + Z_FOR_LOOP_36, \ + Z_FOR_LOOP_35, \ + Z_FOR_LOOP_34, \ + Z_FOR_LOOP_33, \ + Z_FOR_LOOP_32, \ + Z_FOR_LOOP_31, \ + Z_FOR_LOOP_30, \ + Z_FOR_LOOP_29, \ + Z_FOR_LOOP_28, \ + Z_FOR_LOOP_27, \ + Z_FOR_LOOP_26, \ + Z_FOR_LOOP_25, \ + Z_FOR_LOOP_24, \ + Z_FOR_LOOP_23, \ + Z_FOR_LOOP_22, \ + Z_FOR_LOOP_21, \ + Z_FOR_LOOP_20, \ + Z_FOR_LOOP_19, \ + Z_FOR_LOOP_18, \ + Z_FOR_LOOP_17, \ + Z_FOR_LOOP_16, \ + Z_FOR_LOOP_15, \ + Z_FOR_LOOP_14, \ + Z_FOR_LOOP_13, \ + Z_FOR_LOOP_12, \ + Z_FOR_LOOP_11, \ + Z_FOR_LOOP_10, \ + Z_FOR_LOOP_9, \ + Z_FOR_LOOP_8, \ + Z_FOR_LOOP_7, \ + Z_FOR_LOOP_6, \ + Z_FOR_LOOP_5, \ + Z_FOR_LOOP_4, \ + Z_FOR_LOOP_3, \ + Z_FOR_LOOP_2, \ + Z_FOR_LOOP_1, \ + Z_FOR_LOOP_0)(x, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) + +#define Z_GET_ARG_1(_0, ...) _0 + +#define Z_GET_ARG_2(_0, _1, ...) _1 + +#define Z_GET_ARG_3(_0, _1, _2, ...) _2 + +#define Z_GET_ARG_4(_0, _1, _2, _3, ...) _3 + +#define Z_GET_ARG_5(_0, _1, _2, _3, _4, ...) _4 + +#define Z_GET_ARG_6(_0, _1, _2, _3, _4, _5, ...) _5 + +#define Z_GET_ARG_7(_0, _1, _2, _3, _4, _5, _6, ...) _6 + +#define Z_GET_ARG_8(_0, _1, _2, _3, _4, _5, _6, _7, ...) _7 + +#define Z_GET_ARG_9(_0, _1, _2, _3, _4, _5, _6, _7, _8, ...) _8 + +#define Z_GET_ARG_10(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, ...) _9 + +#define Z_GET_ARG_11(_0, _1, _2, _3, _4, _5, \ + _6, _7, _8, _9, _10, ...) _10 + +#define Z_GET_ARG_12(_0, _1, _2, _3, _4, _5, _6,\ + _7, _8, _9, _10, _11, ...) _11 + +#define Z_GET_ARG_13(_0, _1, _2, _3, _4, _5, _6, \ + _7, _8, _9, _10, _11, _12, ...) _12 + +#define Z_GET_ARG_14(_0, _1, _2, _3, _4, _5, _6, \ + _7, _8, _9, _10, _11, _12, _13, ...) _13 + +#define Z_GET_ARG_15(_0, _1, _2, _3, _4, _5, _6, _7, \ + _8, _9, _10, _11, _12, _13, _14, ...) _14 + +#define Z_GET_ARG_16(_0, _1, _2, _3, _4, _5, _6, _7, \ + _8, _9, _10, _11, _12, _13, _14, _15, ...) _15 + +#define Z_GET_ARG_17(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, ...) _16 + +#define Z_GET_ARG_18(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, ...) _17 + +#define Z_GET_ARG_19(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, ...) _18 + +#define Z_GET_ARG_20(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + ...) _19 + +#define Z_GET_ARG_21(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, ...) _20 + +#define Z_GET_ARG_22(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, ...) _21 + +#define Z_GET_ARG_23(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, ...) _22 + +#define Z_GET_ARG_24(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, ...) _23 + +#define Z_GET_ARG_25(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, ...) _24 + +#define Z_GET_ARG_26(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, ...) _25 + +#define Z_GET_ARG_27(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, ...) _26 + +#define Z_GET_ARG_28(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, ...) _27 + +#define Z_GET_ARG_29(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + ...) _28 + +#define Z_GET_ARG_30(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, ...) _29 + +#define Z_GET_ARG_31(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, ...) _30 + +#define Z_GET_ARG_32(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, ...) _31 + +#define Z_GET_ARG_33(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, ...) _32 + +#define Z_GET_ARG_34(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, ...) _33 + +#define Z_GET_ARG_35(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, ...) _34 + +#define Z_GET_ARG_36(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, ...) _35 + +#define Z_GET_ARG_37(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, ...) _36 + +#define Z_GET_ARG_38(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, ...) _37 + +#define Z_GET_ARG_39(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, ...) _38 + +#define Z_GET_ARG_40(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, ...) _39 + +#define Z_GET_ARG_41(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, ...) _40 + +#define Z_GET_ARG_42(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, ...) _41 + +#define Z_GET_ARG_43(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, ...) _42 + +#define Z_GET_ARG_44(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, ...) _43 + +#define Z_GET_ARG_45(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, ...) _44 + +#define Z_GET_ARG_46(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, ...) _45 + +#define Z_GET_ARG_47(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, ...) _46 + +#define Z_GET_ARG_48(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, ...) _47 + +#define Z_GET_ARG_49(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, ...) _48 + +#define Z_GET_ARG_50(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, ...) _49 + +#define Z_GET_ARG_51(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, ...) _50 + +#define Z_GET_ARG_52(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, ...) _51 + +#define Z_GET_ARG_53(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, ...) _52 + +#define Z_GET_ARG_54(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, ...) _53 + +#define Z_GET_ARG_55(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, ...) _54 + +#define Z_GET_ARG_56(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, ...) _55 + +#define Z_GET_ARG_57(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, ...) _56 + +#define Z_GET_ARG_58(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, ...) _57 + +#define Z_GET_ARG_59(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, ...) _58 + +#define Z_GET_ARG_60(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, _59, ...) _59 + +#define Z_GET_ARG_61(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, _59, _60, ...) _60 + +#define Z_GET_ARG_62(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, _59, _60, _61, ...) _61 + +#define Z_GET_ARG_63(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, _59, _60, _61, _62, ...) _62 + +#define Z_GET_ARG_64(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, _59, _60, _61, _62, _63, ...) _63 + +#define Z_GET_ARGS_LESS_0(...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_1(_0, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_2(_0, _1, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_3(_0, _1, _2, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_4(_0, _1, _2, _3, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_5(_0, _1, _2, _3, _4, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_6(_0, _1, _2, _3, _4, _5, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_7(_0, _1, _2, _3, _4, _5, _6, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_8(_0, _1, _2, _3, _4, _5, \ + _6, _7, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_9(_0, _1, _2, _3, _4, _5, \ + _6, _7, _8, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_10(_0, _1, _2, _3, _4, _5, \ + _6, _7, _8, _9, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_11(_0, _1, _2, _3, _4, _5, \ + _6, _7, _8, _9, _10, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_12(_0, _1, _2, _3, _4, _5, _6,\ + _7, _8, _9, _10, _11, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_13(_0, _1, _2, _3, _4, _5, _6, \ + _7, _8, _9, _10, _11, _12, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_14(_0, _1, _2, _3, _4, _5, _6, \ + _7, _8, _9, _10, _11, _12, _13, \ + ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_15(_0, _1, _2, _3, _4, _5, _6, _7, \ + _8, _9, _10, _11, _12, _13, _14, \ + ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_16(_0, _1, _2, _3, _4, _5, _6, _7, \ + _8, _9, _10, _11, _12, _13, _14, _15, ...) \ + __VA_ARGS__ + +#define Z_GET_ARGS_LESS_17(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_18(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, ...) \ + __VA_ARGS__ + +#define Z_GET_ARGS_LESS_19(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, ...) \ + __VA_ARGS__ + +#define Z_GET_ARGS_LESS_20(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_21(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_22(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_23(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_24(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_25(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_26(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_27(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, ...) \ + __VA_ARGS__ + +#define Z_GET_ARGS_LESS_28(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, \ + ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_29(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_30(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_31(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_32(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_33(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_34(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_35(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_36(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_37(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_38(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_39(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_40(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_41(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_42(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_43(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_44(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_45(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_46(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_47(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_48(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_49(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_50(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_51(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_52(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_53(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_54(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_55(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_56(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_57(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_58(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_59(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_60(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, _59, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_61(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, _59, _60, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_62(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, _59, _60, _61, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_63(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, _59, _60, _61, _62, ...) __VA_ARGS__ + +#define Z_GET_ARGS_LESS_64(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, \ + _29, _30, _31, _32, _33, _34, _35, _36, _37, \ + _38, _39, _40, _41, _42, _43, _44, _45, _46, \ + _47, _48, _49, _50, _51, _52, _53, _54, _55, \ + _56, _57, _58, _59, _60, _61, _62, _63, ...) __VA_ARGS__ + +#define Z_FOR_EACH_IDX_FIXED_ARG_EXEC(idx, x, fixed_arg0, fixed_arg1) \ + fixed_arg0(idx, x, fixed_arg1) + +#define Z_FOR_EACH_IDX_FIXED_ARG(F, sep, fixed_arg, ...) \ + Z_FOR_EACH_ENGINE(Z_FOR_EACH_IDX_FIXED_ARG_EXEC, sep, \ + F, fixed_arg, __VA_ARGS__) + +#define Z_FOR_EACH_FIXED_ARG_EXEC(idx, x, fixed_arg0, fixed_arg1) \ + fixed_arg0(x, fixed_arg1) + +#define Z_FOR_EACH_FIXED_ARG(F, sep, fixed_arg, ...) \ + Z_FOR_EACH_ENGINE(Z_FOR_EACH_FIXED_ARG_EXEC, sep, \ + F, fixed_arg, __VA_ARGS__) + +#define Z_FOR_EACH_IDX_EXEC(idx, x, fixed_arg0, fixed_arg1) \ + fixed_arg0(idx, x) + +#define Z_FOR_EACH_IDX(F, sep, ...) \ + Z_FOR_EACH_ENGINE(Z_FOR_EACH_IDX_EXEC, sep, F, _, __VA_ARGS__) + +#define Z_FOR_EACH_EXEC(idx, x, fixed_arg0, fixed_arg1) \ + fixed_arg0(x) + +#define Z_FOR_EACH(F, sep, ...) \ + Z_FOR_EACH_ENGINE(Z_FOR_EACH_EXEC, sep, F, _, __VA_ARGS__) + +#define Z_BYPASS(x) x + +/* Set of UTIL_LISTIFY particles */ +#define Z_UTIL_LISTIFY_0(F, ...) + +#define Z_UTIL_LISTIFY_1(F, ...) \ + F(0, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_2(F, ...) \ + Z_UTIL_LISTIFY_1(F, __VA_ARGS__) \ + F(1, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_3(F, ...) \ + Z_UTIL_LISTIFY_2(F, __VA_ARGS__) \ + F(2, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_4(F, ...) \ + Z_UTIL_LISTIFY_3(F, __VA_ARGS__) \ + F(3, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_5(F, ...) \ + Z_UTIL_LISTIFY_4(F, __VA_ARGS__) \ + F(4, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_6(F, ...) \ + Z_UTIL_LISTIFY_5(F, __VA_ARGS__) \ + F(5, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_7(F, ...) \ + Z_UTIL_LISTIFY_6(F, __VA_ARGS__) \ + F(6, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_8(F, ...) \ + Z_UTIL_LISTIFY_7(F, __VA_ARGS__) \ + F(7, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_9(F, ...) \ + Z_UTIL_LISTIFY_8(F, __VA_ARGS__) \ + F(8, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_10(F, ...) \ + Z_UTIL_LISTIFY_9(F, __VA_ARGS__) \ + F(9, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_11(F, ...) \ + Z_UTIL_LISTIFY_10(F, __VA_ARGS__) \ + F(10, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_12(F, ...) \ + Z_UTIL_LISTIFY_11(F, __VA_ARGS__) \ + F(11, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_13(F, ...) \ + Z_UTIL_LISTIFY_12(F, __VA_ARGS__) \ + F(12, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_14(F, ...) \ + Z_UTIL_LISTIFY_13(F, __VA_ARGS__) \ + F(13, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_15(F, ...) \ + Z_UTIL_LISTIFY_14(F, __VA_ARGS__) \ + F(14, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_16(F, ...) \ + Z_UTIL_LISTIFY_15(F, __VA_ARGS__) \ + F(15, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_17(F, ...) \ + Z_UTIL_LISTIFY_16(F, __VA_ARGS__) \ + F(16, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_18(F, ...) \ + Z_UTIL_LISTIFY_17(F, __VA_ARGS__) \ + F(17, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_19(F, ...) \ + Z_UTIL_LISTIFY_18(F, __VA_ARGS__) \ + F(18, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_20(F, ...) \ + Z_UTIL_LISTIFY_19(F, __VA_ARGS__) \ + F(19, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_21(F, ...) \ + Z_UTIL_LISTIFY_20(F, __VA_ARGS__) \ + F(20, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_22(F, ...) \ + Z_UTIL_LISTIFY_21(F, __VA_ARGS__) \ + F(21, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_23(F, ...) \ + Z_UTIL_LISTIFY_22(F, __VA_ARGS__) \ + F(22, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_24(F, ...) \ + Z_UTIL_LISTIFY_23(F, __VA_ARGS__) \ + F(23, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_25(F, ...) \ + Z_UTIL_LISTIFY_24(F, __VA_ARGS__) \ + F(24, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_26(F, ...) \ + Z_UTIL_LISTIFY_25(F, __VA_ARGS__) \ + F(25, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_27(F, ...) \ + Z_UTIL_LISTIFY_26(F, __VA_ARGS__) \ + F(26, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_28(F, ...) \ + Z_UTIL_LISTIFY_27(F, __VA_ARGS__) \ + F(27, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_29(F, ...) \ + Z_UTIL_LISTIFY_28(F, __VA_ARGS__) \ + F(28, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_30(F, ...) \ + Z_UTIL_LISTIFY_29(F, __VA_ARGS__) \ + F(29, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_31(F, ...) \ + Z_UTIL_LISTIFY_30(F, __VA_ARGS__) \ + F(30, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_32(F, ...) \ + Z_UTIL_LISTIFY_31(F, __VA_ARGS__) \ + F(31, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_33(F, ...) \ + Z_UTIL_LISTIFY_32(F, __VA_ARGS__) \ + F(32, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_34(F, ...) \ + Z_UTIL_LISTIFY_33(F, __VA_ARGS__) \ + F(33, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_35(F, ...) \ + Z_UTIL_LISTIFY_34(F, __VA_ARGS__) \ + F(34, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_36(F, ...) \ + Z_UTIL_LISTIFY_35(F, __VA_ARGS__) \ + F(35, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_37(F, ...) \ + Z_UTIL_LISTIFY_36(F, __VA_ARGS__) \ + F(36, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_38(F, ...) \ + Z_UTIL_LISTIFY_37(F, __VA_ARGS__) \ + F(37, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_39(F, ...) \ + Z_UTIL_LISTIFY_38(F, __VA_ARGS__) \ + F(38, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_40(F, ...) \ + Z_UTIL_LISTIFY_39(F, __VA_ARGS__) \ + F(39, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_41(F, ...) \ + Z_UTIL_LISTIFY_40(F, __VA_ARGS__) \ + F(40, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_42(F, ...) \ + Z_UTIL_LISTIFY_41(F, __VA_ARGS__) \ + F(41, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_43(F, ...) \ + Z_UTIL_LISTIFY_42(F, __VA_ARGS__) \ + F(42, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_44(F, ...) \ + Z_UTIL_LISTIFY_43(F, __VA_ARGS__) \ + F(43, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_45(F, ...) \ + Z_UTIL_LISTIFY_44(F, __VA_ARGS__) \ + F(44, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_46(F, ...) \ + Z_UTIL_LISTIFY_45(F, __VA_ARGS__) \ + F(45, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_47(F, ...) \ + Z_UTIL_LISTIFY_46(F, __VA_ARGS__) \ + F(46, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_48(F, ...) \ + Z_UTIL_LISTIFY_47(F, __VA_ARGS__) \ + F(47, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_49(F, ...) \ + Z_UTIL_LISTIFY_48(F, __VA_ARGS__) \ + F(48, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_50(F, ...) \ + Z_UTIL_LISTIFY_49(F, __VA_ARGS__) \ + F(49, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_51(F, ...) \ + Z_UTIL_LISTIFY_50(F, __VA_ARGS__) \ + F(50, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_52(F, ...) \ + Z_UTIL_LISTIFY_51(F, __VA_ARGS__) \ + F(51, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_53(F, ...) \ + Z_UTIL_LISTIFY_52(F, __VA_ARGS__) \ + F(52, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_54(F, ...) \ + Z_UTIL_LISTIFY_53(F, __VA_ARGS__) \ + F(53, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_55(F, ...) \ + Z_UTIL_LISTIFY_54(F, __VA_ARGS__) \ + F(54, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_56(F, ...) \ + Z_UTIL_LISTIFY_55(F, __VA_ARGS__) \ + F(55, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_57(F, ...) \ + Z_UTIL_LISTIFY_56(F, __VA_ARGS__) \ + F(56, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_58(F, ...) \ + Z_UTIL_LISTIFY_57(F, __VA_ARGS__) \ + F(57, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_59(F, ...) \ + Z_UTIL_LISTIFY_58(F, __VA_ARGS__) \ + F(58, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_60(F, ...) \ + Z_UTIL_LISTIFY_59(F, __VA_ARGS__) \ + F(59, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_61(F, ...) \ + Z_UTIL_LISTIFY_60(F, __VA_ARGS__) \ + F(60, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_62(F, ...) \ + Z_UTIL_LISTIFY_61(F, __VA_ARGS__) \ + F(61, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_63(F, ...) \ + Z_UTIL_LISTIFY_62(F, __VA_ARGS__) \ + F(62, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_64(F, ...) \ + Z_UTIL_LISTIFY_63(F, __VA_ARGS__) \ + F(63, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_65(F, ...) \ + Z_UTIL_LISTIFY_64(F, __VA_ARGS__) \ + F(64, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_66(F, ...) \ + Z_UTIL_LISTIFY_65(F, __VA_ARGS__) \ + F(65, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_67(F, ...) \ + Z_UTIL_LISTIFY_66(F, __VA_ARGS__) \ + F(66, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_68(F, ...) \ + Z_UTIL_LISTIFY_67(F, __VA_ARGS__) \ + F(67, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_69(F, ...) \ + Z_UTIL_LISTIFY_68(F, __VA_ARGS__) \ + F(68, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_70(F, ...) \ + Z_UTIL_LISTIFY_69(F, __VA_ARGS__) \ + F(69, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_71(F, ...) \ + Z_UTIL_LISTIFY_70(F, __VA_ARGS__) \ + F(70, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_72(F, ...) \ + Z_UTIL_LISTIFY_71(F, __VA_ARGS__) \ + F(71, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_73(F, ...) \ + Z_UTIL_LISTIFY_72(F, __VA_ARGS__) \ + F(72, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_74(F, ...) \ + Z_UTIL_LISTIFY_73(F, __VA_ARGS__) \ + F(73, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_75(F, ...) \ + Z_UTIL_LISTIFY_74(F, __VA_ARGS__) \ + F(74, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_76(F, ...) \ + Z_UTIL_LISTIFY_75(F, __VA_ARGS__) \ + F(75, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_77(F, ...) \ + Z_UTIL_LISTIFY_76(F, __VA_ARGS__) \ + F(76, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_78(F, ...) \ + Z_UTIL_LISTIFY_77(F, __VA_ARGS__) \ + F(77, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_79(F, ...) \ + Z_UTIL_LISTIFY_78(F, __VA_ARGS__) \ + F(78, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_80(F, ...) \ + Z_UTIL_LISTIFY_79(F, __VA_ARGS__) \ + F(79, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_81(F, ...) \ + Z_UTIL_LISTIFY_80(F, __VA_ARGS__) \ + F(80, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_82(F, ...) \ + Z_UTIL_LISTIFY_81(F, __VA_ARGS__) \ + F(81, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_83(F, ...) \ + Z_UTIL_LISTIFY_82(F, __VA_ARGS__) \ + F(82, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_84(F, ...) \ + Z_UTIL_LISTIFY_83(F, __VA_ARGS__) \ + F(83, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_85(F, ...) \ + Z_UTIL_LISTIFY_84(F, __VA_ARGS__) \ + F(84, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_86(F, ...) \ + Z_UTIL_LISTIFY_85(F, __VA_ARGS__) \ + F(85, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_87(F, ...) \ + Z_UTIL_LISTIFY_86(F, __VA_ARGS__) \ + F(86, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_88(F, ...) \ + Z_UTIL_LISTIFY_87(F, __VA_ARGS__) \ + F(87, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_89(F, ...) \ + Z_UTIL_LISTIFY_88(F, __VA_ARGS__) \ + F(88, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_90(F, ...) \ + Z_UTIL_LISTIFY_89(F, __VA_ARGS__) \ + F(89, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_91(F, ...) \ + Z_UTIL_LISTIFY_90(F, __VA_ARGS__) \ + F(90, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_92(F, ...) \ + Z_UTIL_LISTIFY_91(F, __VA_ARGS__) \ + F(91, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_93(F, ...) \ + Z_UTIL_LISTIFY_92(F, __VA_ARGS__) \ + F(92, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_94(F, ...) \ + Z_UTIL_LISTIFY_93(F, __VA_ARGS__) \ + F(93, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_95(F, ...) \ + Z_UTIL_LISTIFY_94(F, __VA_ARGS__) \ + F(94, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_96(F, ...) \ + Z_UTIL_LISTIFY_95(F, __VA_ARGS__) \ + F(95, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_97(F, ...) \ + Z_UTIL_LISTIFY_96(F, __VA_ARGS__) \ + F(96, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_98(F, ...) \ + Z_UTIL_LISTIFY_97(F, __VA_ARGS__) \ + F(97, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_99(F, ...) \ + Z_UTIL_LISTIFY_98(F, __VA_ARGS__) \ + F(98, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_100(F, ...) \ + Z_UTIL_LISTIFY_99(F, __VA_ARGS__) \ + F(99, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_101(F, ...) \ + Z_UTIL_LISTIFY_100(F, __VA_ARGS__) \ + F(100, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_102(F, ...) \ + Z_UTIL_LISTIFY_101(F, __VA_ARGS__) \ + F(101, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_103(F, ...) \ + Z_UTIL_LISTIFY_102(F, __VA_ARGS__) \ + F(102, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_104(F, ...) \ + Z_UTIL_LISTIFY_103(F, __VA_ARGS__) \ + F(103, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_105(F, ...) \ + Z_UTIL_LISTIFY_104(F, __VA_ARGS__) \ + F(104, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_106(F, ...) \ + Z_UTIL_LISTIFY_105(F, __VA_ARGS__) \ + F(105, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_107(F, ...) \ + Z_UTIL_LISTIFY_106(F, __VA_ARGS__) \ + F(106, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_108(F, ...) \ + Z_UTIL_LISTIFY_107(F, __VA_ARGS__) \ + F(107, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_109(F, ...) \ + Z_UTIL_LISTIFY_108(F, __VA_ARGS__) \ + F(108, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_110(F, ...) \ + Z_UTIL_LISTIFY_109(F, __VA_ARGS__) \ + F(109, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_111(F, ...) \ + Z_UTIL_LISTIFY_110(F, __VA_ARGS__) \ + F(110, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_112(F, ...) \ + Z_UTIL_LISTIFY_111(F, __VA_ARGS__) \ + F(111, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_113(F, ...) \ + Z_UTIL_LISTIFY_112(F, __VA_ARGS__) \ + F(112, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_114(F, ...) \ + Z_UTIL_LISTIFY_113(F, __VA_ARGS__) \ + F(113, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_115(F, ...) \ + Z_UTIL_LISTIFY_114(F, __VA_ARGS__) \ + F(114, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_116(F, ...) \ + Z_UTIL_LISTIFY_115(F, __VA_ARGS__) \ + F(115, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_117(F, ...) \ + Z_UTIL_LISTIFY_116(F, __VA_ARGS__) \ + F(116, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_118(F, ...) \ + Z_UTIL_LISTIFY_117(F, __VA_ARGS__) \ + F(117, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_119(F, ...) \ + Z_UTIL_LISTIFY_118(F, __VA_ARGS__) \ + F(118, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_120(F, ...) \ + Z_UTIL_LISTIFY_119(F, __VA_ARGS__) \ + F(119, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_121(F, ...) \ + Z_UTIL_LISTIFY_120(F, __VA_ARGS__) \ + F(120, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_122(F, ...) \ + Z_UTIL_LISTIFY_121(F, __VA_ARGS__) \ + F(121, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_123(F, ...) \ + Z_UTIL_LISTIFY_122(F, __VA_ARGS__) \ + F(122, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_124(F, ...) \ + Z_UTIL_LISTIFY_123(F, __VA_ARGS__) \ + F(123, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_125(F, ...) \ + Z_UTIL_LISTIFY_124(F, __VA_ARGS__) \ + F(124, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_126(F, ...) \ + Z_UTIL_LISTIFY_125(F, __VA_ARGS__) \ + F(125, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_127(F, ...) \ + Z_UTIL_LISTIFY_126(F, __VA_ARGS__) \ + F(126, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_128(F, ...) \ + Z_UTIL_LISTIFY_127(F, __VA_ARGS__) \ + F(127, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_129(F, ...) \ + Z_UTIL_LISTIFY_128(F, __VA_ARGS__) \ + F(128, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_130(F, ...) \ + Z_UTIL_LISTIFY_129(F, __VA_ARGS__) \ + F(129, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_131(F, ...) \ + Z_UTIL_LISTIFY_130(F, __VA_ARGS__) \ + F(130, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_132(F, ...) \ + Z_UTIL_LISTIFY_131(F, __VA_ARGS__) \ + F(131, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_133(F, ...) \ + Z_UTIL_LISTIFY_132(F, __VA_ARGS__) \ + F(132, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_134(F, ...) \ + Z_UTIL_LISTIFY_133(F, __VA_ARGS__) \ + F(133, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_135(F, ...) \ + Z_UTIL_LISTIFY_134(F, __VA_ARGS__) \ + F(134, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_136(F, ...) \ + Z_UTIL_LISTIFY_135(F, __VA_ARGS__) \ + F(135, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_137(F, ...) \ + Z_UTIL_LISTIFY_136(F, __VA_ARGS__) \ + F(136, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_138(F, ...) \ + Z_UTIL_LISTIFY_137(F, __VA_ARGS__) \ + F(137, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_139(F, ...) \ + Z_UTIL_LISTIFY_138(F, __VA_ARGS__) \ + F(138, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_140(F, ...) \ + Z_UTIL_LISTIFY_139(F, __VA_ARGS__) \ + F(139, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_141(F, ...) \ + Z_UTIL_LISTIFY_140(F, __VA_ARGS__) \ + F(140, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_142(F, ...) \ + Z_UTIL_LISTIFY_141(F, __VA_ARGS__) \ + F(141, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_143(F, ...) \ + Z_UTIL_LISTIFY_142(F, __VA_ARGS__) \ + F(142, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_144(F, ...) \ + Z_UTIL_LISTIFY_143(F, __VA_ARGS__) \ + F(143, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_145(F, ...) \ + Z_UTIL_LISTIFY_144(F, __VA_ARGS__) \ + F(144, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_146(F, ...) \ + Z_UTIL_LISTIFY_145(F, __VA_ARGS__) \ + F(145, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_147(F, ...) \ + Z_UTIL_LISTIFY_146(F, __VA_ARGS__) \ + F(146, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_148(F, ...) \ + Z_UTIL_LISTIFY_147(F, __VA_ARGS__) \ + F(147, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_149(F, ...) \ + Z_UTIL_LISTIFY_148(F, __VA_ARGS__) \ + F(148, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_150(F, ...) \ + Z_UTIL_LISTIFY_149(F, __VA_ARGS__) \ + F(149, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_151(F, ...) \ + Z_UTIL_LISTIFY_150(F, __VA_ARGS__) \ + F(150, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_152(F, ...) \ + Z_UTIL_LISTIFY_151(F, __VA_ARGS__) \ + F(151, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_153(F, ...) \ + Z_UTIL_LISTIFY_152(F, __VA_ARGS__) \ + F(152, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_154(F, ...) \ + Z_UTIL_LISTIFY_153(F, __VA_ARGS__) \ + F(153, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_155(F, ...) \ + Z_UTIL_LISTIFY_154(F, __VA_ARGS__) \ + F(154, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_156(F, ...) \ + Z_UTIL_LISTIFY_155(F, __VA_ARGS__) \ + F(155, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_157(F, ...) \ + Z_UTIL_LISTIFY_156(F, __VA_ARGS__) \ + F(156, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_158(F, ...) \ + Z_UTIL_LISTIFY_157(F, __VA_ARGS__) \ + F(157, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_159(F, ...) \ + Z_UTIL_LISTIFY_158(F, __VA_ARGS__) \ + F(158, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_160(F, ...) \ + Z_UTIL_LISTIFY_159(F, __VA_ARGS__) \ + F(159, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_161(F, ...) \ + Z_UTIL_LISTIFY_160(F, __VA_ARGS__) \ + F(160, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_162(F, ...) \ + Z_UTIL_LISTIFY_161(F, __VA_ARGS__) \ + F(161, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_163(F, ...) \ + Z_UTIL_LISTIFY_162(F, __VA_ARGS__) \ + F(162, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_164(F, ...) \ + Z_UTIL_LISTIFY_163(F, __VA_ARGS__) \ + F(163, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_165(F, ...) \ + Z_UTIL_LISTIFY_164(F, __VA_ARGS__) \ + F(164, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_166(F, ...) \ + Z_UTIL_LISTIFY_165(F, __VA_ARGS__) \ + F(165, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_167(F, ...) \ + Z_UTIL_LISTIFY_166(F, __VA_ARGS__) \ + F(166, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_168(F, ...) \ + Z_UTIL_LISTIFY_167(F, __VA_ARGS__) \ + F(167, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_169(F, ...) \ + Z_UTIL_LISTIFY_168(F, __VA_ARGS__) \ + F(168, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_170(F, ...) \ + Z_UTIL_LISTIFY_169(F, __VA_ARGS__) \ + F(169, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_171(F, ...) \ + Z_UTIL_LISTIFY_170(F, __VA_ARGS__) \ + F(170, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_172(F, ...) \ + Z_UTIL_LISTIFY_171(F, __VA_ARGS__) \ + F(171, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_173(F, ...) \ + Z_UTIL_LISTIFY_172(F, __VA_ARGS__) \ + F(172, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_174(F, ...) \ + Z_UTIL_LISTIFY_173(F, __VA_ARGS__) \ + F(173, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_175(F, ...) \ + Z_UTIL_LISTIFY_174(F, __VA_ARGS__) \ + F(174, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_176(F, ...) \ + Z_UTIL_LISTIFY_175(F, __VA_ARGS__) \ + F(175, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_177(F, ...) \ + Z_UTIL_LISTIFY_176(F, __VA_ARGS__) \ + F(176, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_178(F, ...) \ + Z_UTIL_LISTIFY_177(F, __VA_ARGS__) \ + F(177, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_179(F, ...) \ + Z_UTIL_LISTIFY_178(F, __VA_ARGS__) \ + F(178, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_180(F, ...) \ + Z_UTIL_LISTIFY_179(F, __VA_ARGS__) \ + F(179, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_181(F, ...) \ + Z_UTIL_LISTIFY_180(F, __VA_ARGS__) \ + F(180, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_182(F, ...) \ + Z_UTIL_LISTIFY_181(F, __VA_ARGS__) \ + F(181, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_183(F, ...) \ + Z_UTIL_LISTIFY_182(F, __VA_ARGS__) \ + F(182, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_184(F, ...) \ + Z_UTIL_LISTIFY_183(F, __VA_ARGS__) \ + F(183, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_185(F, ...) \ + Z_UTIL_LISTIFY_184(F, __VA_ARGS__) \ + F(184, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_186(F, ...) \ + Z_UTIL_LISTIFY_185(F, __VA_ARGS__) \ + F(185, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_187(F, ...) \ + Z_UTIL_LISTIFY_186(F, __VA_ARGS__) \ + F(186, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_188(F, ...) \ + Z_UTIL_LISTIFY_187(F, __VA_ARGS__) \ + F(187, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_189(F, ...) \ + Z_UTIL_LISTIFY_188(F, __VA_ARGS__) \ + F(188, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_190(F, ...) \ + Z_UTIL_LISTIFY_189(F, __VA_ARGS__) \ + F(189, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_191(F, ...) \ + Z_UTIL_LISTIFY_190(F, __VA_ARGS__) \ + F(190, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_192(F, ...) \ + Z_UTIL_LISTIFY_191(F, __VA_ARGS__) \ + F(191, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_193(F, ...) \ + Z_UTIL_LISTIFY_192(F, __VA_ARGS__) \ + F(192, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_194(F, ...) \ + Z_UTIL_LISTIFY_193(F, __VA_ARGS__) \ + F(193, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_195(F, ...) \ + Z_UTIL_LISTIFY_194(F, __VA_ARGS__) \ + F(194, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_196(F, ...) \ + Z_UTIL_LISTIFY_195(F, __VA_ARGS__) \ + F(195, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_197(F, ...) \ + Z_UTIL_LISTIFY_196(F, __VA_ARGS__) \ + F(196, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_198(F, ...) \ + Z_UTIL_LISTIFY_197(F, __VA_ARGS__) \ + F(197, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_199(F, ...) \ + Z_UTIL_LISTIFY_198(F, __VA_ARGS__) \ + F(198, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_200(F, ...) \ + Z_UTIL_LISTIFY_199(F, __VA_ARGS__) \ + F(199, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_201(F, ...) \ + Z_UTIL_LISTIFY_200(F, __VA_ARGS__) \ + F(200, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_202(F, ...) \ + Z_UTIL_LISTIFY_201(F, __VA_ARGS__) \ + F(201, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_203(F, ...) \ + Z_UTIL_LISTIFY_202(F, __VA_ARGS__) \ + F(202, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_204(F, ...) \ + Z_UTIL_LISTIFY_203(F, __VA_ARGS__) \ + F(203, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_205(F, ...) \ + Z_UTIL_LISTIFY_204(F, __VA_ARGS__) \ + F(204, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_206(F, ...) \ + Z_UTIL_LISTIFY_205(F, __VA_ARGS__) \ + F(205, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_207(F, ...) \ + Z_UTIL_LISTIFY_206(F, __VA_ARGS__) \ + F(206, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_208(F, ...) \ + Z_UTIL_LISTIFY_207(F, __VA_ARGS__) \ + F(207, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_209(F, ...) \ + Z_UTIL_LISTIFY_208(F, __VA_ARGS__) \ + F(208, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_210(F, ...) \ + Z_UTIL_LISTIFY_209(F, __VA_ARGS__) \ + F(209, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_211(F, ...) \ + Z_UTIL_LISTIFY_210(F, __VA_ARGS__) \ + F(210, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_212(F, ...) \ + Z_UTIL_LISTIFY_211(F, __VA_ARGS__) \ + F(211, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_213(F, ...) \ + Z_UTIL_LISTIFY_212(F, __VA_ARGS__) \ + F(212, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_214(F, ...) \ + Z_UTIL_LISTIFY_213(F, __VA_ARGS__) \ + F(213, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_215(F, ...) \ + Z_UTIL_LISTIFY_214(F, __VA_ARGS__) \ + F(214, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_216(F, ...) \ + Z_UTIL_LISTIFY_215(F, __VA_ARGS__) \ + F(215, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_217(F, ...) \ + Z_UTIL_LISTIFY_216(F, __VA_ARGS__) \ + F(216, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_218(F, ...) \ + Z_UTIL_LISTIFY_217(F, __VA_ARGS__) \ + F(217, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_219(F, ...) \ + Z_UTIL_LISTIFY_218(F, __VA_ARGS__) \ + F(218, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_220(F, ...) \ + Z_UTIL_LISTIFY_219(F, __VA_ARGS__) \ + F(219, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_221(F, ...) \ + Z_UTIL_LISTIFY_220(F, __VA_ARGS__) \ + F(220, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_222(F, ...) \ + Z_UTIL_LISTIFY_221(F, __VA_ARGS__) \ + F(221, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_223(F, ...) \ + Z_UTIL_LISTIFY_222(F, __VA_ARGS__) \ + F(222, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_224(F, ...) \ + Z_UTIL_LISTIFY_223(F, __VA_ARGS__) \ + F(223, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_225(F, ...) \ + Z_UTIL_LISTIFY_224(F, __VA_ARGS__) \ + F(224, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_226(F, ...) \ + Z_UTIL_LISTIFY_225(F, __VA_ARGS__) \ + F(225, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_227(F, ...) \ + Z_UTIL_LISTIFY_226(F, __VA_ARGS__) \ + F(226, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_228(F, ...) \ + Z_UTIL_LISTIFY_227(F, __VA_ARGS__) \ + F(227, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_229(F, ...) \ + Z_UTIL_LISTIFY_228(F, __VA_ARGS__) \ + F(228, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_230(F, ...) \ + Z_UTIL_LISTIFY_229(F, __VA_ARGS__) \ + F(229, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_231(F, ...) \ + Z_UTIL_LISTIFY_230(F, __VA_ARGS__) \ + F(230, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_232(F, ...) \ + Z_UTIL_LISTIFY_231(F, __VA_ARGS__) \ + F(231, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_233(F, ...) \ + Z_UTIL_LISTIFY_232(F, __VA_ARGS__) \ + F(232, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_234(F, ...) \ + Z_UTIL_LISTIFY_233(F, __VA_ARGS__) \ + F(233, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_235(F, ...) \ + Z_UTIL_LISTIFY_234(F, __VA_ARGS__) \ + F(234, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_236(F, ...) \ + Z_UTIL_LISTIFY_235(F, __VA_ARGS__) \ + F(235, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_237(F, ...) \ + Z_UTIL_LISTIFY_236(F, __VA_ARGS__) \ + F(236, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_238(F, ...) \ + Z_UTIL_LISTIFY_237(F, __VA_ARGS__) \ + F(237, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_239(F, ...) \ + Z_UTIL_LISTIFY_238(F, __VA_ARGS__) \ + F(238, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_240(F, ...) \ + Z_UTIL_LISTIFY_239(F, __VA_ARGS__) \ + F(239, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_241(F, ...) \ + Z_UTIL_LISTIFY_240(F, __VA_ARGS__) \ + F(240, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_242(F, ...) \ + Z_UTIL_LISTIFY_241(F, __VA_ARGS__) \ + F(241, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_243(F, ...) \ + Z_UTIL_LISTIFY_242(F, __VA_ARGS__) \ + F(242, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_244(F, ...) \ + Z_UTIL_LISTIFY_243(F, __VA_ARGS__) \ + F(243, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_245(F, ...) \ + Z_UTIL_LISTIFY_244(F, __VA_ARGS__) \ + F(244, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_246(F, ...) \ + Z_UTIL_LISTIFY_245(F, __VA_ARGS__) \ + F(245, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_247(F, ...) \ + Z_UTIL_LISTIFY_246(F, __VA_ARGS__) \ + F(246, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_248(F, ...) \ + Z_UTIL_LISTIFY_247(F, __VA_ARGS__) \ + F(247, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_249(F, ...) \ + Z_UTIL_LISTIFY_248(F, __VA_ARGS__) \ + F(248, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_250(F, ...) \ + Z_UTIL_LISTIFY_249(F, __VA_ARGS__) \ + F(249, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_251(F, ...) \ + Z_UTIL_LISTIFY_250(F, __VA_ARGS__) \ + F(250, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_252(F, ...) \ + Z_UTIL_LISTIFY_251(F, __VA_ARGS__) \ + F(251, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_253(F, ...) \ + Z_UTIL_LISTIFY_252(F, __VA_ARGS__) \ + F(252, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_254(F, ...) \ + Z_UTIL_LISTIFY_253(F, __VA_ARGS__) \ + F(253, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_255(F, ...) \ + Z_UTIL_LISTIFY_254(F, __VA_ARGS__) \ + F(254, __VA_ARGS__) + +#define Z_UTIL_LISTIFY_256(F, ...) \ + Z_UTIL_LISTIFY_255(F, __VA_ARGS__) \ + F(255, __VA_ARGS__) + +#endif /* ZEPHYR_INCLUDE_SYS_UTIL_LOOPS_H_ */ diff --git a/include/sys/util_macro.h b/include/sys/util_macro.h index 06315da491b28c..2bd74795caf0f5 100644 --- a/include/sys/util_macro.h +++ b/include/sys/util_macro.h @@ -265,7 +265,7 @@ extern "C" { * * @return Nth argument. */ -#define GET_ARG_N(N, ...) _Z_GET_ARG_N(N, 1, __VA_ARGS__) +#define GET_ARG_N(N, ...) Z_GET_ARG_##N(__VA_ARGS__) /** * @brief Strips n first arguments from the argument list. @@ -275,7 +275,7 @@ extern "C" { * * @return argument list without N first arguments. */ -#define GET_ARGS_LESS_N(N, ...) _Z_GET_ARG_N(UTIL_INC(N), 0, __VA_ARGS__) +#define GET_ARGS_LESS_N(N, ...) Z_GET_ARGS_LESS_##N(__VA_ARGS__) /** Expands to the first argument. * @@ -344,7 +344,7 @@ extern "C" { * @note Calling UTIL_LISTIFY with undefined arguments has undefined * behavior. */ -#define UTIL_LISTIFY(LEN, F, ...) UTIL_EVAL(UTIL_REPEAT(LEN, F, __VA_ARGS__)) +#define UTIL_LISTIFY(LEN, F, ...) UTIL_CAT(Z_UTIL_LISTIFY_, LEN)(F, __VA_ARGS__) /** * @brief Call a macro @p F on each provided argument with a given @@ -368,9 +368,7 @@ extern "C" { * F(element) for each element in the list. */ #define FOR_EACH(F, sep, ...) \ - Z_FOR_EACH_IDX2(NUM_VA_ARGS_LESS_1(__VA_ARGS__, _), \ - 0, Z_FOR_EACH_SWALLOW_INDEX_FIXED_ARG, sep, \ - F, 0, __VA_ARGS__) + Z_FOR_EACH(F, sep, REVERSE_ARGS(__VA_ARGS__)) /** * @brief Like FOR_EACH(), but with a terminator instead of a separator, @@ -462,9 +460,7 @@ extern "C" { * F(index, element) for each element in the list. */ #define FOR_EACH_IDX(F, sep, ...) \ - Z_FOR_EACH_IDX2(NUM_VA_ARGS_LESS_1(__VA_ARGS__, _), \ - 0, Z_FOR_EACH_SWALLOW_FIXED_ARG, sep, \ - F, 0, __VA_ARGS__) + Z_FOR_EACH_IDX(F, sep, REVERSE_ARGS(__VA_ARGS__)) /** * @brief Call macro @p F on each provided argument, with an additional fixed @@ -492,9 +488,7 @@ extern "C" { * F(element, fixed_arg) for each element in the list. */ #define FOR_EACH_FIXED_ARG(F, sep, fixed_arg, ...) \ - Z_FOR_EACH_IDX2(NUM_VA_ARGS_LESS_1(__VA_ARGS__, _), \ - 0, Z_FOR_EACH_SWALLOW_INDEX, sep, \ - F, fixed_arg, __VA_ARGS__) + Z_FOR_EACH_FIXED_ARG(F, sep, fixed_arg, REVERSE_ARGS(__VA_ARGS__)) /** * @brief Calls macro @p F for each variable argument with an index and fixed @@ -522,9 +516,14 @@ extern "C" { * the list. */ #define FOR_EACH_IDX_FIXED_ARG(F, sep, fixed_arg, ...) \ - Z_FOR_EACH_IDX2(NUM_VA_ARGS_LESS_1(__VA_ARGS__, _), \ - 0, Z_FOR_EACH_SWALLOW_NOTHING, sep, \ - F, fixed_arg, __VA_ARGS__) + Z_FOR_EACH_IDX_FIXED_ARG(F, sep, fixed_arg, REVERSE_ARGS(__VA_ARGS__)) + +/** @brief Reverse arguments order. + * + * @param ... Variable argument list. + */ +#define REVERSE_ARGS(...) \ + Z_FOR_EACH_ENGINE(Z_FOR_EACH_EXEC, (,), Z_BYPASS, _, __VA_ARGS__) /** * @brief Number of arguments in the variable arguments list minus one.