xiaoxiang781216 commented on code in PR #20015:
URL: https://github.com/apache/nuttx/pull/20015#discussion_r3891107928
##########
include/nuttx/macro.h:
##########
@@ -149,4 +149,61 @@
#define FOREACH_ARG(action, param, ...) \
FOREACH_ARG_(action, GET_ARG_COUNT(__VA_ARGS__), param, ##__VA_ARGS__)
+/* Apply the macro to each argument, passing the position of the argument
+ * as a two digit literal (00, 01, 02, ...) rather than as an expression.
+ * Use it when the index has to be pasted into an identifier, for instance
+ * to build a symbol name the linker can sort. The arguments are reversed
+ * before the expansion, so the actions are emitted from the last argument
+ * to the first while the indexes still follow the original order, which is
+ * transparent for the declarations this form is meant to generate.
+ */
+
+#define FOREACH_IDX_0(action, param, ...)
Review Comment:
could we modify FOREACH_ARG directly
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]