From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Tue, 3 Oct 2017 08:51:48 -0400 Subject: [U-Boot] [U-Boot, 3/9] include: Add a variadic macro to call a callback for all arguments In-Reply-To: <20170903150031.18179-4-marek.behun@nic.cz> References: <20170903150031.18179-4-marek.behun@nic.cz> Message-ID: <20171003125148.GF22973@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On Sun, Sep 03, 2017 at 05:00:25PM +0200, Marek Beh=C3=BAn wrote: > Add a header variadic-macro.h which defines the CALL_MACRO_FOR_EACH marco. >=20 > This macro can be used as follows: > #define TEST(x) > CALL_MACRO_FOR_EACH(TEST, a, b, c, d) >=20 > This will expand to > TEST(a) TEST(b) TEST(c) TEST(d) >=20 > 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). >=20 > Signed-off-by: Marek Behun >=20 > create mode 100644 include/u-boot/variadic-macro.h >=20 > diff --git a/include/u-boot/variadic-macro.h b/include/u-boot/variadic-ma= cro.h > new file mode 100644 > index 0000000000..922beafcea Applied to u-boot/master, thanks! --=20 Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: