git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 05/11] Remove va_copy at MSVC because there are va_copy.

From
Frank Li <lznuaa@gmail.com>
Date
Aug 17, 2009, 16:04 UTC
Message-ID
<1250525040-5868-1-git-send-email-lznuaa@gmail.com>

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: Johannes Schindelin
Message 1 of 10 in “Remove va_copy at MSVC because there are va_copy.”
  1. 05/11 Remove va_copy at MSVC because there are va_copy.Frank Li, Aug 17, 2009
  2. Johannes SchindelinAug 17, 2009
  3. Joshua JensenAug 17, 2009
  4. Paolo BonziniAug 17, 2009
  5. Reece DunnAug 17, 2009
  6. Erik Faye-LundAug 17, 2009
  7. Erik Faye-LundAug 17, 2009
  8. Johannes SchindelinAug 17, 2009
  9. Frank LiAug 18, 2009
  10. Johannes SchindelinAug 18, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.