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

Side by Side Diff: webrtc/typedefs.h

Issue 1516423004: Update WARN_UNUSED_RESULT macro to match Chromium's version. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 defined(WEBRTC_DETECT_NEON) 61 defined(WEBRTC_DETECT_NEON)
62 #define WEBRTC_CPU_DETECTION 62 #define WEBRTC_CPU_DETECTION
63 #endif 63 #endif
64 64
65 // TODO(pbos): Use webrtc/base/basictypes.h instead to include fixed-size ints. 65 // TODO(pbos): Use webrtc/base/basictypes.h instead to include fixed-size ints.
66 #include <stdint.h> 66 #include <stdint.h>
67 67
68 // Annotate a function indicating the caller must examine the return value. 68 // Annotate a function indicating the caller must examine the return value.
69 // Use like: 69 // Use like:
70 // int foo() WARN_UNUSED_RESULT; 70 // int foo() WARN_UNUSED_RESULT;
71 // To explicitly ignore a result, see |ignore_result()| in <base/macros.h>.
71 // TODO(ajm): Hack to avoid multiple definitions until the base/ of webrtc and 72 // TODO(ajm): Hack to avoid multiple definitions until the base/ of webrtc and
72 // libjingle are merged. 73 // libjingle are merged.
73 #if !defined(WARN_UNUSED_RESULT) 74 #if !defined(WARN_UNUSED_RESULT)
74 #if defined(__GNUC__) 75 #if defined(__GNUC__) || defined(__clang__)
75 #define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 76 #define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
76 #else 77 #else
77 #define WARN_UNUSED_RESULT 78 #define WARN_UNUSED_RESULT
78 #endif 79 #endif
79 #endif // WARN_UNUSED_RESULT 80 #endif // WARN_UNUSED_RESULT
80 81
81 // Put after a variable that might not be used, to prevent compiler warnings: 82 // Put after a variable that might not be used, to prevent compiler warnings:
82 // int result ATTRIBUTE_UNUSED = DoSomething(); 83 // int result ATTRIBUTE_UNUSED = DoSomething();
83 // assert(result == 17); 84 // assert(result == 17);
84 #ifndef ATTRIBUTE_UNUSED 85 #ifndef ATTRIBUTE_UNUSED
(...skipping 17 matching lines...) Expand all
102 // Annotate a function that will not return control flow to the caller. 103 // Annotate a function that will not return control flow to the caller.
103 #if defined(_MSC_VER) 104 #if defined(_MSC_VER)
104 #define NO_RETURN __declspec(noreturn) 105 #define NO_RETURN __declspec(noreturn)
105 #elif defined(__GNUC__) 106 #elif defined(__GNUC__)
106 #define NO_RETURN __attribute__((noreturn)) 107 #define NO_RETURN __attribute__((noreturn))
107 #else 108 #else
108 #define NO_RETURN 109 #define NO_RETURN
109 #endif 110 #endif
110 111
111 #endif // WEBRTC_TYPEDEFS_H_ 112 #endif // WEBRTC_TYPEDEFS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698