diff options
author | Patrick Steinhardt <ps@pks.im> | 2018-02-08 14:05:17 +0300 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2018-06-10 20:30:40 +0300 |
commit | 396e49600c2131b5727d07f06fb28ba3c0c73923 (patch) | |
tree | fc86fb69a858d59893249bb9f00f42f577aef501 /include/git2/common.h | |
parent | c8ee52703b18b667981008a1f12fac993dee91ec (diff) |
common.h: create `GIT_DEPRECATED` macro
Diffstat (limited to 'include/git2/common.h')
-rw-r--r-- | include/git2/common.h | 11 |
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))) |