Bug 1202965 (part 1) - Add MOZ_UNUSED. r=froydnj.

This commit is contained in:
Nicholas Nethercote 2015-09-09 17:01:28 -07:00
parent bd0011b79c
commit b5bc43ef27

View File

@ -9,6 +9,8 @@
#include "mozilla/Types.h"
#ifdef __cplusplus
namespace mozilla {
//
@ -29,4 +31,11 @@ operator<<(const unused_t& /*unused*/, const T& /*unused*/)
} // namespace mozilla
#endif // __cplusplus
// An alternative to mozilla::unused for use in (a) C code and (b) code where
// linking with unused.o is difficult.
#define MOZ_UNUSED(expr) \
do { if (expr) { (void)0; } } while (0)
#endif // mozilla_unused_h