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

[PATCH 2/3] mingw.h: Define only if necessary

From
SSSven Strickroth <sven@cs-ware.de>
Date
May 9, 2013, 01:13 UTC
Message-ID
<518AF81C.10302@cs-ware.de>
In-Reply-To
<518AF79A.5000408@cs-ware.de>

Since the latest version of MSVC EWOULDBLOCK, EAFNOSUPPORT and ECONNABORTED are defined in errno.h. When used with MSVC mingw.h is included from msvc.h and causes warnings about redefinitions.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
---
 compat/mingw.h | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/compat/mingw.h b/compat/mingw.h
index 685cd2c..c424333 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -32,7 +32,9 @@ typedef int socklen_t;
 #define WEXITSTATUS(x) ((x) & 0xff)
 #define WTERMSIG(x) SIGTERM
 
+#ifndef EWOULDBLOCK
 #define EWOULDBLOCK EAGAIN
+#endif
 #define SHUT_WR SD_SEND
 
 #define SIGHUP 1
@@ -46,8 +48,12 @@ typedef int socklen_t;
 #define F_SETFD 2
 #define FD_CLOEXEC 0x1
 
+#ifndef EAFNOSUPPORT
 #define EAFNOSUPPORT WSAEAFNOSUPPORT
+#endif
+#ifndef ECONNABORTED
 #define ECONNABORTED WSAECONNABORTED
+#endif
 
 struct passwd {
 	char *pw_name;
-- 
Best regards,
 Sven Strickroth
 PGP key id F5A9D4C4 @ any key-server
Previous: Sven StrickrothNext: Sven Strickroth
Message 4 of 9 in “MSVC fixes”
  1. 0/3 MSVC fixesSven Strickroth, May 9, 2013
  2. 1/3 poll.h lies in the same folder, so use normal quotes for includeSven Strickroth, May 9, 2013
  3. Sven StrickrothMay 9, 2013
  4. 2/3 mingw.h: Define only if necessarySven Strickroth, May 9, 2013
  5. 3/3 Initialize variables with valuesSven Strickroth, May 9, 2013
  6. Krzysztof MazurMay 9, 2013
  7. Jonathan NiederMay 9, 2013
  8. Sven StrickrothMay 9, 2013
  9. René ScharfeMay 9, 2013

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.