From: Benoit Sigoure <tsunanet@gmail.com>
To: git@vger.kernel.org
Cc: Benoit Sigoure <tsunanet@gmail.com>
Subject: [PATCH] Cleanly redefine (v)snprintf when needed.
Date: Thu, 30 Jan 2014 22:25:12 -0800 [thread overview]
Message-ID: <1391149512-8705-1-git-send-email-tsunanet@gmail.com> (raw)
When we detect that vsnprintf / snprintf are broken, we #define them to
an alternative implementation. On OS X, stdio.h already #define's them,
which causes a warning to be issued at the point we re-define them in
`git-compat-util.h'.
---
git-compat-util.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/git-compat-util.h b/git-compat-util.h
index cbd86c3..614a5e9 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -480,9 +480,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);
--
1.9.rc1.1.g186f0be.dirty
next reply other threads:[~2014-01-31 6:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 6:25 Benoit Sigoure [this message]
2014-01-31 17:28 ` [PATCH] Cleanly redefine (v)snprintf when needed Junio C Hamano
2014-01-31 17:36 ` Benoit Sigoure
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391149512-8705-1-git-send-email-tsunanet@gmail.com \
--to=tsunanet@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).