0004-Fix-macro-problem-with-gai_strerror-on-Windows.patch
text/x-patch
Filename: 0004-Fix-macro-problem-with-gai_strerror-on-Windows.patch
Type: text/x-patch
Part: 3
Patch
Format: format-patch
Series: patch 0004
Subject: Fix macro problem with gai_strerror on Windows.
| File | + | − |
|---|---|---|
| src/include/port/win32/netdb.h | 0 | 2 |
| src/include/port/win32/sys/socket.h | 0 | 7 |
From 967bdf2d3acfcb8ee20942577d51cbeb6cca5c9b Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Mon, 15 Aug 2022 16:19:08 +1200
Subject: [PATCH 4/6] Fix macro problem with gai_strerror on Windows.
Commit 5579388d was confused about why gai_strerror() didn't work on
Windows, and had to be redirected with a macro to gai_strerrorA(). It
turns out that we explicitly undefined Windows' own macro for that
somewhere else. Oops. Get rid of all that, so now we can use
gai_sterror() directly using declarations from the system headers.
---
src/include/port/win32/netdb.h | 2 --
src/include/port/win32/sys/socket.h | 7 -------
2 files changed, 9 deletions(-)
diff --git a/src/include/port/win32/netdb.h b/src/include/port/win32/netdb.h
index f0cc2c2367..9ed13e457b 100644
--- a/src/include/port/win32/netdb.h
+++ b/src/include/port/win32/netdb.h
@@ -4,6 +4,4 @@
#include <ws2tcpip.h>
-#define gai_strerror gai_strerrorA
-
#endif
diff --git a/src/include/port/win32/sys/socket.h b/src/include/port/win32/sys/socket.h
index 9b2cdf3b9b..0c32c0f7b2 100644
--- a/src/include/port/win32/sys/socket.h
+++ b/src/include/port/win32/sys/socket.h
@@ -23,11 +23,4 @@
#define ERROR PGERROR
#endif
-/*
- * we can't use the windows gai_strerror{AW} functions because
- * they are defined inline in the MS header files. So we'll use our
- * own
- */
-#undef gai_strerror
-
#endif /* WIN32_SYS_SOCKET_H */
--
2.35.1