aboutsummaryrefslogtreecommitdiff
path: root/src/common/basictypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/basictypes.h')
-rw-r--r--src/common/basictypes.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common/basictypes.h b/src/common/basictypes.h
index 84668b79..9426c1f6 100644
--- a/src/common/basictypes.h
+++ b/src/common/basictypes.h
@@ -38,4 +38,21 @@
void operator=(const TypeName&)
#endif // DISALLOW_COPY_AND_ASSIGN
+namespace google_breakpad {
+
+// Used to explicitly mark the return value of a function as unused. If you are
+// really sure you don't want to do anything with the return value of a function
+// that has been marked with __attribute__((warn_unused_result)), wrap it with
+// this. Example:
+//
+// scoped_ptr<MyType> my_var = ...;
+// if (TakeOwnership(my_var.get()) == SUCCESS)
+// ignore_result(my_var.release());
+//
+template<typename T>
+inline void ignore_result(const T&) {
+}
+
+} // namespace google_breakpad
+
#endif // COMMON_BASICTYPES_H_