diff options
Diffstat (limited to 'include/git2/errors.h')
-rw-r--r-- | include/git2/errors.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h index 54da869b4..e3f5f4cb0 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -122,9 +122,12 @@ typedef struct { typedef enum { GITERR_NOMEMORY, + GITERR_REFERENCE, } git_error_class; +#define GITERR_CHECK_ALLOC(ptr, error) if (ptr == NULL) { giterr_set_oom(error); return -1 } + GIT_EXTERN(void) giterr_set(git_error **error_out, int error_class, const char *string, ...); GIT_EXTERN(void) giterr_set_oom(git_error **error); GIT_EXTERN(void) giterr_free(git_error *error); |