From: Frank Li <lznuaa@gmail.com>
To: git@vger.kernel.org, msysgit@googlegroups.com
Cc: Johannes.Schindelin@gmx.de, Frank Li <lznuaa@gmail.com>
Subject: [PATCH 05/11] Remove va_copy at MSVC because there are va_copy.
Date: Tue, 18 Aug 2009 00:04:00 +0800 [thread overview]
Message-ID: <1250525040-5868-1-git-send-email-lznuaa@gmail.com> (raw)
MSVs have not implemented va_copy. remove va_copy at MSVC environment.
It will malloc buffer each time.
Signed-off-by: Frank Li <lznuaa@gmail.com>
---
compat/winansi.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/compat/winansi.c b/compat/winansi.c
index 9217c24..6091138 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -3,7 +3,11 @@
*/
#include <windows.h>
+#ifdef _MSC_VER
+#include <stdio.h>
+#else
#include "../git-compat-util.h"
+#endif
/*
Functions to be wrapped:
@@ -310,9 +314,13 @@ static int winansi_vfprintf(FILE *stream, const char *format, va_list list)
if (!console)
goto abort;
+#ifndef _MSC_VER
va_copy(cp, list);
len = vsnprintf(small_buf, sizeof(small_buf), format, cp);
va_end(cp);
+#else
+ len= sizeof(small_buf) ;
+#endif
if (len > sizeof(small_buf) - 1) {
buf = malloc(len + 1);
--
1.6.4.msysgit.0
next reply other threads:[~2009-08-17 16:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-17 16:04 Frank Li [this message]
2009-08-17 16:49 ` [PATCH 05/11] Remove va_copy at MSVC because there are va_copy Johannes Schindelin
2009-08-17 18:22 ` Joshua Jensen
2009-08-17 16:53 ` Paolo Bonzini
2009-08-17 16:56 ` Reece Dunn
2009-08-17 17:02 ` Erik Faye-Lund
2009-08-17 17:26 ` Erik Faye-Lund
2009-08-17 19:46 ` Johannes Schindelin
2009-08-18 5:06 ` Frank Li
2009-08-18 9:54 ` Johannes Schindelin
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=1250525040-5868-1-git-send-email-lznuaa@gmail.com \
--to=lznuaa@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=msysgit@googlegroups.com \
/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