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.
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -310,17 +310,17 @@ MOZ_CrashPrintf(const char* aFilename, i
* a printf-style format string, which must be a string literal and between
* 1 and 4 additional arguments. A regular MOZ_CRASH() is preferred wherever
* possible, as passing arbitrary strings to printf from a potentially
* compromised process is not without risk.
*/
#define MOZ_CRASH_UNSAFE_PRINTF(format, ...) \
do { \
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!"); \
static_assert(sizeof(format) <= sPrintfCrashReasonSize, \
"The supplied format string is too long!"); \
MOZ_CALL_CRASH_PRINTF("" format, __VA_ARGS__); \
} while (0)
MOZ_END_EXTERN_C
--- a/xpcom/base/nsIClassInfoImpl.h
+++ b/xpcom/base/nsIClassInfoImpl.h
@@ -151,19 +151,17 @@ NS_CI_INTERFACE_GETTER_NAME(_class)(uint
sizeof(nsIID));
#define NS_CLASSINFO_HELPER_END \
MOZ_ASSERT(i == *count, "Incorrent number of entries"); \
return NS_OK; \
}
#define NS_IMPL_CI_INTERFACE_GETTER(aClass, ...) \
- NS_CLASSINFO_HELPER_BEGIN(aClass, \
- MOZ_PASTE_PREFIX_AND_ARG_COUNT(/* No prefix */, \
- __VA_ARGS__)) \
+ NS_CLASSINFO_HELPER_BEGIN(aClass, MOZ_ARG_COUNT(__VA_ARGS__)) \
MOZ_FOR_EACH(NS_CLASSINFO_HELPER_ENTRY, (), (__VA_ARGS__)) \
NS_CLASSINFO_HELPER_END
#define NS_IMPL_QUERY_INTERFACE_CI(aClass, ...) \
NS_INTERFACE_MAP_BEGIN(aClass) \
MOZ_FOR_EACH(NS_INTERFACE_MAP_ENTRY, (), (__VA_ARGS__)) \
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, MOZ_ARG_1(__VA_ARGS__)) \
NS_IMPL_QUERY_CLASSINFO(aClass) \