Index: webrtc/typedefs.h |
diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h |
index 16e10c5ea14590bc78815a6a2e4486863b8f9fa5..bc48c08290c7653416073ebe36a0d12a99259195 100644 |
--- a/webrtc/typedefs.h |
+++ b/webrtc/typedefs.h |
@@ -80,6 +80,8 @@ |
// Put after a variable that might not be used, to prevent compiler warnings: |
// int result ATTRIBUTE_UNUSED = DoSomething(); |
// assert(result == 17); |
+// Deprecated since it only works with GCC & clang. See RTC_UNUSED below. |
+// TODO(terelius): Remove. |
#ifndef ATTRIBUTE_UNUSED |
#if defined(__GNUC__) || defined(__clang__) |
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) |
@@ -109,4 +111,14 @@ |
#endif |
#endif |
+// Prevent the compiler from warning about an unused variable. For example: |
+// int result = DoSomething(); |
+// assert(result == 17); |
+// RTC_UNUSED(result); |
+// Note: In most cases it is better to remove the unused variable rather than |
+// suppressing the compiler warning. |
+#ifndef RTC_UNUSED |
+#define RTC_UNUSED(x) static_cast<void>(x) |
+#endif // RTC_UNUSED |
+ |
#endif // WEBRTC_TYPEDEFS_H_ |