diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2018-06-11 18:26:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-11 18:26:22 +0100 |
| commit | 3be7301151e44537d2423386dc71f1d3e496c664 (patch) | |
| tree | 655ff1fc09e227c77a1c8853706e5180a78f5a50 /include/git2 | |
| parent | e6444dacb88e29e75fee81a87d1876db77d43362 (diff) | |
| parent | ecf4f33a4e327a91496f72816f9f02d923e5af05 (diff) | |
| download | libgit2-3be7301151e44537d2423386dc71f1d3e496c664.tar.gz | |
Merge pull request #4436 from pks-t/pks/packfile-stream-free
pack: rename `git_packfile_stream_free`
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))) |
