summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorBenoit Sigoure <tsunanet@gmail.com>2014-01-30 22:25:12 -0800
committerJunio C Hamano <gitster@pobox.com>2014-01-31 09:55:29 -0800
commitab03803c02ef6b41ed5086771bab2de4860c96a9 (patch)
tree426b9f6a2abfe07af0ed74acb03129d787af9b1f /git-compat-util.h
parentf174a2583c9f42315b60205890fa67a79a1f1669 (diff)
downloadgit-ab03803c02ef6b41ed5086771bab2de4860c96a9.tar.gz
git-compat-util.h: #undef (v)snprintf before #define thembs/stdio-undef-before-redef
When we detect that vsnprintf / snprintf are broken, we #define them to an alternative implementation. On OS X, stdio.h already re-define them in `git-compat-util.h'. Signed-off-by: Benoit Sigoure <tsunanet@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 041cbdb93e..f1fa9e611b 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -374,9 +374,15 @@ extern FILE *git_fopen(const char*, const char*);
#endif
#ifdef SNPRINTF_RETURNS_BOGUS
+#ifdef snprintf
+#undef snprintf
+#endif
#define snprintf git_snprintf
extern int git_snprintf(char *str, size_t maxsize,
const char *format, ...);
+#ifdef vsnprintf
+#undef vsnprintf
+#endif
#define vsnprintf git_vsnprintf
extern int git_vsnprintf(char *str, size_t maxsize,
const char *format, va_list ap);