Fix macro problem with gai_strerror on Windows.
authorThomas Munro <tmunro@postgresql.org>
Thu, 18 Aug 2022 04:16:00 +0000 (16:16 +1200)
committerThomas Munro <tmunro@postgresql.org>
Thu, 18 Aug 2022 04:31:11 +0000 (16:31 +1200)
Commit 5579388d was confused about why gai_strerror() didn't work, and
used gai_strerrorA().  It turns out that we had explicitly undefined
Windows' own macro for that somewhere else.  Get rid of all that, and
use the system headers' definition of gai_sterror() directly as
intended.

Discussion: https://postgr.es/m/CA+hUKGKErNfhmvb_H0UprEmp4LPzGN06yR2_0tYikjzB-2ECMw@mail.gmail.com

src/include/port/win32/netdb.h
src/include/port/win32/sys/socket.h

index f0cc2c2367ebfa4e17651693932b8dd9483b74e9..9ed13e457b8cdbdc2ee8b3f2886332559b4c1a74 100644 (file)
@@ -4,6 +4,4 @@
 
 #include <ws2tcpip.h>
 
-#define gai_strerror gai_strerrorA
-
 #endif
index 9b2cdf3b9bcab926c99e9adbc90d0787b15ad4a5..0c32c0f7b2ec34e2c50f32928ebaf9c02491fd68 100644 (file)
 #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 */