Bug 1369622 - Use MOZ_ARG_COUNT instead of MOZ_PASTE_PREFIX_AND_ARG_COUNT. r=froydnj

In a couple places, MOZ_PASTE_PREFIX_AND_ARG_COUNT is used to only count
the number of arguments, we can now use MOZ_ARG_COUNT directly for that.

--HG--
extra : rebase_source : 1064e4cc231863dc4aff83ee6bc90d318b4be418
This commit is contained in:
Mike Hommey 2017-06-02 15:06:34 +09:00
parent 38a6de0fe3
commit 8914ace4ce
2 changed files with 2 additions and 4 deletions

View File

@ -315,7 +315,7 @@ MOZ_CrashPrintf(const char* aFilename, int aLine, const char* aFormat, ...);
#define MOZ_CRASH_UNSAFE_PRINTF(format, ...) \ #define MOZ_CRASH_UNSAFE_PRINTF(format, ...) \
do { \ do { \
static_assert( \ static_assert( \
MOZ_PASTE_PREFIX_AND_ARG_COUNT(, __VA_ARGS__) <= sPrintfMaxArgs, \ MOZ_ARG_COUNT(__VA_ARGS__) <= sPrintfMaxArgs, \
"Only up to 4 additional arguments are allowed!"); \ "Only up to 4 additional arguments are allowed!"); \
static_assert(sizeof(format) <= sPrintfCrashReasonSize, \ static_assert(sizeof(format) <= sPrintfCrashReasonSize, \
"The supplied format string is too long!"); \ "The supplied format string is too long!"); \

View File

@ -156,9 +156,7 @@ NS_CI_INTERFACE_GETTER_NAME(_class)(uint32_t *count, nsIID ***array) \
} }
#define NS_IMPL_CI_INTERFACE_GETTER(aClass, ...) \ #define NS_IMPL_CI_INTERFACE_GETTER(aClass, ...) \
NS_CLASSINFO_HELPER_BEGIN(aClass, \ NS_CLASSINFO_HELPER_BEGIN(aClass, MOZ_ARG_COUNT(__VA_ARGS__)) \
MOZ_PASTE_PREFIX_AND_ARG_COUNT(/* No prefix */, \
__VA_ARGS__)) \
MOZ_FOR_EACH(NS_CLASSINFO_HELPER_ENTRY, (), (__VA_ARGS__)) \ MOZ_FOR_EACH(NS_CLASSINFO_HELPER_ENTRY, (), (__VA_ARGS__)) \
NS_CLASSINFO_HELPER_END NS_CLASSINFO_HELPER_END