Commit Graph
4 Commits
Author SHA1 Message Date
Mike Hommey f7bc9c2dc4 Bug 1369622 - Fix MOZ_FOR_EACH with an empty list. r=froydnj
I'm not sure how I tested MOZ_FOR_EACH in bug 1368932, but it turns out
it doesn't work with an empty list, despite
MOZ_PASTE_PREFIX_AND_ARG_COUNT now supporting 0 arguments.

Macros can be tricky, and it ends up being easier to make things work
cross-compiler with a separate macro that does the counting, and
(re)building MOZ_PASTE_PREFIX_AND_ARG_COUNT on top of that. Then
MOZ_FOR_EACH ends up working as expected with an empty list.

So this adds a MOZ_ARG_COUNT macro that counts the number of variadic
arguments it's given, and derives MOZ_PASTE_PREFIX_AND_ARG_COUNT from
it.

And this adds a testcase validating that MOZ_FOR_EACH works properly
with an empty list as a result.
2017-06-02 14:53:54 +09:00
Xidorn Quan dac6cc5e35 Bug 1345074 - Add MOZ_FOR_EACH_SEPARATED which adds separator between items. r=Waldo
MozReview-Commit-ID: IWqs17MLhHD
2017-03-07 22:28:49 +11:00
Nicholas Nethercote c0e8a3e8c5 Bug 1041914 - Convert the fourth quarter of MFBT to Gecko style. r=Ms2ger. 2014-07-22 20:54:41 -07:00
Birunthan Mohanathas 049c840308 Bug 989460 - Part 2: Add MOZ_FOR_EACH macro. r=Waldo 2014-04-24 10:49:00 +02:00