Skip to content

Commit 396e496

Browse files
committed
common.h: create GIT_DEPRECATED macro
1 parent c8ee527 commit 396e496

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/git2/common.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ typedef size_t size_t;
4848
# define GIT_EXTERN(type) extern type
4949
#endif
5050

51+
/** Declare a function as deprecated. */
52+
#if defined(__GNUC__)
53+
# define GIT_DEPRECATED(func) \
54+
__attribute__((deprecated)) \
55+
func
56+
#elif defined(_MSC_VER)
57+
# define GIT_DEPRECATED(func) __declspec(deprecated) func
58+
#else
59+
# define GIT_DEPRECATED(func) func
60+
#endif
61+
5162
/** Declare a function's takes printf style arguments. */
5263
#ifdef __GNUC__
5364
# define GIT_FORMAT_PRINTF(a,b) __attribute__((format (printf, a, b)))

0 commit comments

Comments
 (0)