| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 |
| 11 | #ifndef RTC_BASE_SYSTEM_UNUSED_H_ |
| 12 | #define RTC_BASE_SYSTEM_UNUSED_H_ |
| 13 |
| 14 | // Prevent the compiler from warning about an unused variable. For example: |
| 15 | // int result = DoSomething(); |
| 16 | // RTC_DCHECK(result == 17); |
| 17 | // RTC_UNUSED(result); |
| 18 | // Note: In most cases it is better to remove the unused variable rather than |
| 19 | // suppressing the compiler warning. |
| 20 | #ifndef RTC_UNUSED |
| 21 | #ifdef __cplusplus |
| 22 | #define RTC_UNUSED(x) static_cast<void>(x) |
| 23 | #else |
| 24 | #define RTC_UNUSED(x) (void)(x) |
| 25 | #endif |
| 26 | #endif // RTC_UNUSED |
| 27 |
| 28 | #endif // RTC_BASE_SYSTEM_UNUSED_H_ |
| 29 |