Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: webrtc/typedefs.h

Issue 2756483002: Use RTC_UNUSED instead of conditional compilation in BWE simulator tool. (Closed)
Patch Set: Attempt static_cast<void>(x) Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/test/metric_recorder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/test/metric_recorder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698