summaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-03-18 16:17:14 -0700
committerVicent Martí <vicent@github.com>2013-03-18 16:17:14 -0700
commit5b27bf7e5bfd5c2f92a15c0058c801d49faf8403 (patch)
treeeb4e79c950ec3260ad8a532b4d84dae2ad60ae5d /src/common.h
parent50eb8520d06ac0c484a0ce3a3fba6c5da25ec976 (diff)
parent324602514fec5ba04fa236c67d633f9b18ad9845 (diff)
downloadlibgit2-5b27bf7e5bfd5c2f92a15c0058c801d49faf8403.tar.gz
Merge pull request #1417 from arrbee/opts-for-paths
Implement opts interface for global/system file search paths
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index e3a9e1984..235da0412 100644
--- a/src/common.h
+++ b/src/common.h
@@ -56,6 +56,12 @@
#define GITERR_CHECK_ALLOC(ptr) if (ptr == NULL) { return -1; }
/**
+ * Check a return value and propogate result if non-zero.
+ */
+#define GITERR_CHECK_ERROR(code) \
+ do { int _err = (code); if (_err < 0) return _err; } while (0)
+
+/**
* Set the error message for this thread, formatting as needed.
*/
void giterr_set(int error_class, const char *string, ...);