Skip to content
Snippets Groups Projects
Commit 59981e6a authored by Marek Behún's avatar Marek Behún Committed by Tom Rini
Browse files

include: Add a variadic macro to call a callback for all arguments


Add a header variadic-macro.h which defines the CALL_MACRO_FOR_EACH marco.

This macro can be used as follows:
  #define TEST(x)
  CALL_MACRO_FOR_EACH(TEST, a, b, c, d)

This will expand to
  TEST(a) TEST(b) TEST(c) TEST(d)

The nice thing is that CALL_MACRO_FOR_EACH is a variadic macro, thus the
number of arguments can vary (although it has an upper limit - in this
implementation 32 arguments).

Signed-off-by: default avatarMarek Behun <marek.behun@nic.cz>

 create mode 100644 include/u-boot/variadic-macro.h
parent 5994e8b6
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment