| #
be129a10 |
| 03-Sep-2017 |
Marek Behún <marek.behun@nic.cz> |
UPSTREAM: 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
UPSTREAM: 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).
Change-Id: Ic186ed444a78a86a4cfa10f9ca1198c0bfa9af10 Signed-off-by: Marek Behun <marek.behun@nic.cz> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit 59981e6a3d6074bf5413c1875a95325a4b8c01ca)
show more ...
|