[U-Boot] [U-Boot, 3/9] include: Add a variadic macro to call a callback for all arguments
Tom Rini
trini at konsulko.com
Tue Oct 3 12:51:48 UTC 2017
On Sun, Sep 03, 2017 at 05:00:25PM +0200, Marek BehĂșn wrote:
> 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: Marek Behun <marek.behun at nic.cz>
>
> create mode 100644 include/u-boot/variadic-macro.h
>
> diff --git a/include/u-boot/variadic-macro.h b/include/u-boot/variadic-macro.h
> new file mode 100644
> index 0000000000..922beafcea
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171003/d33599ae/attachment.sig>
More information about the U-Boot
mailing list