nuttx/Documentation/components
Jorge Guzman f595ba31e2
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
include/nuttx/macro.h: Let FOREACH_ARG() paste the argument index
FOREACH_ARG() hands the position of each argument as the expression
"count - N", which can be used as a value but cannot be pasted into an
identifier, because "##" pastes a single token.  Hand it out as a
literal instead, so that an action macro can build a symbol name out of
it, which is what a subsystem needs when the link order of its objects
has to follow the declaration order.

The list is reversed through REVERSE_ARG() so that the position becomes
the level of the chain, and each step emits the recursion before its own
action so that the actions still come out in the order the arguments
were given.  This is how the same problem is solved upstream in Zephyr,
whose FOR_EACH_IDX() also reverses the list before walking a per arity
chain.

The index values are unchanged, so the arithmetic use keeps working:
NOTE_PRINTF_TYPES(), the only user in tree, produces the same tags for
every argument count.  It now supplies the leading zero itself, because
FOREACH_ARG() no longer expands to "0" when the list is empty.  An empty
list expanding to nothing is what lets an action expanding to
declarations be used at file scope.

Assisted-by: Claude Code
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-09-01 17:55:52 -03:00
..
arch
audio Documentation/audio: document the audio upper half interface 2026-08-05 07:58:53 +02:00
concurrency Documentation: Add documentation for seqcount. 2025-12-22 10:22:06 -03:00
drivers Documentation/sensors_uorb: add the LSM6DS3TR-C driver page 2026-08-29 11:11:14 -03:00
filesystem !arch/arm: Use r9 as the PIC base register. 2026-08-06 01:38:23 +08:00
libs include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
mm mm/iob: add iob_init method to support external buffer init as iob structure 2025-12-25 10:08:49 +08:00
net Documentation/net: document lower-half driver performance tuning 2026-07-13 11:53:26 +02:00
nxgraphics !boards/boardctl: Remove BOARDIOC_INIT 2026-05-26 09:57:29 +08:00
tools sched,fs,docs: support setuid sudo helper 2026-08-18 15:57:52 +08:00
binfmt.rst style: fix typos 2025-04-30 13:45:46 +08:00
boards.rst Documentation/components/boards.rst: fix typo 2026-06-04 09:58:42 +08:00
cmake.rst
crypto.rst crypto: Support SHA2_224_HMAC 2026-07-04 14:15:17 +08:00
index.rst include/nuttx: Add link-time iterable sections infrastructure 2026-08-27 01:04:05 +08:00
iterable_sections.rst include/nuttx/macro.h: Let FOREACH_ARG() paste the argument index 2026-09-01 17:55:52 -03:00
nxflat.rst Documentation/nxflat: Document the in-tree mknxflat and the ABI marker. 2026-08-06 01:38:23 +08:00
openamp.rst
paging.rst style: fix typos 2025-04-30 13:45:46 +08:00
syscall.rst Documentation: fix spelling 2025-05-15 11:33:41 +08:00
video.rst
wireless.rst