OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2017 The WebRTC Project Authors. All rights reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
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 WEBRTC_BASE_ANNOTATIONS_H_ | |
the sun
2017/03/14 20:07:00
Please introduce this in a separate CL so we can d
kwiberg-webrtc
2017/03/16 10:24:12
Would do, except I think following some of your ot
| |
12 #define WEBRTC_BASE_ANNOTATIONS_H_ | |
13 | |
14 // Annotate function return values with this if you want to force callers to do | |
15 // something with the return value: | |
16 // | |
17 // RTC_WARN_UNUSED_RESULT(bool) SomethingThatMayFail(); | |
18 // ... | |
19 // SomethingThatMayFail(); // Warning! Ignoring the return value. | |
20 // if (SomethingThatMayFail()) { // OK! | |
21 #if defined(__GNUC__) | |
22 #define RTC_WARN_UNUSED_RESULT(t) t __attribute__((__warn_unused_result__)) | |
23 #else | |
24 #define RTC_WARN_UNUSED_RESULT(t) t | |
25 #endif | |
26 | |
27 #endif // WEBRTC_BASE_ANNOTATIONS_H_ | |
OLD | NEW |