summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/git2/common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/git2/common.h b/include/git2/common.h
index f65cfdd01..d9a2d4081 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -48,6 +48,17 @@ typedef size_t size_t;
# define GIT_EXTERN(type) extern type
#endif
+/** Declare a function as deprecated. */
+#if defined(__GNUC__)
+# define GIT_DEPRECATED(func) \
+ __attribute__((deprecated)) \
+ func
+#elif defined(_MSC_VER)
+# define GIT_DEPRECATED(func) __declspec(deprecated) func
+#else
+# define GIT_DEPRECATED(func) func
+#endif
+
/** Declare a function's takes printf style arguments. */
#ifdef __GNUC__
# define GIT_FORMAT_PRINTF(a,b) __attribute__((format (printf, a, b)))