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

[PATCH 09/12] Don't include windows.h at winansi.c at MSVC build

From
Frank Li <lznuaa@gmail.com>
Date
Aug 19, 2009, 15:52 UTC
Message-ID
<1250697167-5536-9-git-send-email-lznuaa@gmail.com>
In-Reply-To
<1250697167-5536-8-git-send-email-lznuaa@gmail.com>

msvc.h include winsock2.h, which conflict windows.h. msvc.h define minimized required windows version

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/winansi.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/compat/winansi.c b/compat/winansi.c
index 9217c24..15053d0 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -1,8 +1,9 @@
 /*
  * Copyright 2008 Peter Harris <git@peter.is-a-geek.org>
  */
-
+#ifndef _MSC_VER
 #include <windows.h>
+#endif
 #include "../git-compat-util.h"
 
 /*
-- 
1.6.4.msysgit.0
Previous: Frank LiNext: Frank Li
Message 9 of 12 in “Avoid declaration after instruction”
  1. 01/12 Avoid declaration after instructionFrank Li, Aug 19, 2009
  2. 02/12 Define SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++Frank Li, Aug 19, 2009
  3. 03/12 Using macro WIN32 replace __MINGW32_ at Windows special handler The code which is conditional on MinGW32 is actually conditional on Windows. Use WIN32 macro will share both MINGW32 and MSVC environment.Frank Li, Aug 19, 2009
  4. 04/12 mingw.c: Use the O_BINARY flag to open filesFrank Li, Aug 19, 2009
  5. 05/12 Place __stdcall between return value and function nameFrank Li, Aug 19, 2009
  6. 06/12 Add _MSC_VER in porting head file git-compat-util.hFrank Li, Aug 19, 2009
  7. 07/12 Add Unix header files to build git at MSVC.Frank Li, Aug 19, 2009
  8. 08/12 Add MSVC porting files.Frank Li, Aug 19, 2009
  9. 09/12 Don't include windows.h at winansi.c at MSVC buildFrank Li, Aug 19, 2009
  10. 10/12 Fix errcode have defined as int at MSVCFrank Li, Aug 19, 2009
  11. 11/12 Add MSVC Project fileFrank Li, Aug 19, 2009
  12. Erik Faye-LundAug 19, 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.