Index: base/compiler_specific.h |
diff --git a/base/compiler_specific.h b/base/compiler_specific.h |
index 02603df584599bf7b92d4384a0c2912402307b7c..09f862fa8e64cd181e48038feaa38bb2581b4e38 100644 |
--- a/base/compiler_specific.h |
+++ b/base/compiler_specific.h |
@@ -119,11 +119,14 @@ |
// Use like: |
// int foo() WARN_UNUSED_RESULT; |
// To explicitly ignore a result, see |ignore_result()| in base/macros.h. |
-#if defined(COMPILER_GCC) |
+// TODO(dcheng): Update //third_party/webrtc's macro definition to match. |
danakj
2015/10/07 16:16:54
Could we ifdef then undef and redefine here?
dcheng
2015/10/07 16:41:34
Done (I just unconditionally undef since this file
|
+#if !defined(WARN_UNUSED_RESULT) |
+#if defined(COMPILER_GCC) || defined(__clang__) |
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
#else |
#define WARN_UNUSED_RESULT |
#endif |
+#endif |
// Tell the compiler a function is using a printf-style format string. |
// |format_param| is the one-based index of the format string parameter; |