diff options
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/buffer.h | 14 | ||||
| -rw-r--r-- | include/git2/common.h | 11 |
2 files changed, 24 insertions, 1 deletions
diff --git a/include/git2/buffer.h b/include/git2/buffer.h index 9fc6a5805..41cd126b3 100644 --- a/include/git2/buffer.h +++ b/include/git2/buffer.h @@ -69,7 +69,19 @@ typedef struct { * * @param buffer The buffer to deallocate */ -GIT_EXTERN(void) git_buf_free(git_buf *buffer); +GIT_EXTERN(void) git_buf_dispose(git_buf *buffer); + +/** + * Alias of `git_buf_dispose`. + * + * This function is directly calls `git_buf_dispose` now and is deprecated. + * Going forward, we refer to functions freeing the internal state of a + * structure a `dispose` function, while functions freeing the structure + * themselves will be called a `free` function. + * + * This function is going to be removed in v0.30.0. + */ +GIT_EXTERN(void) GIT_DEPRECATED(git_buf_free)(git_buf *buffer); /** * Resize the buffer allocation to make more space. diff --git a/include/git2/common.h b/include/git2/common.h index f095e5990..fc820cae7 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))) |
