summaryrefslogtreecommitdiff
path: root/include/git2/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2/common.h')
-rw-r--r--include/git2/common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/git2/common.h b/include/git2/common.h
index 4402dfda8..5f64a37f8 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -71,6 +71,13 @@ typedef size_t size_t;
# define GIT_FORMAT_PRINTF(a,b) /* empty */
#endif
+/** Declare that a function's return value must be used. */
+#if defined(__GNUC__)
+# define GIT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#else
+# define GIT_WARN_UNUSED_RESULT
+#endif
+
#if (defined(_WIN32)) && !defined(__CYGWIN__)
#define GIT_WIN32 1
#endif