summaryrefslogtreecommitdiff
path: root/src/include/getaddrinfo.h
diff options
context:
space:
mode:
authorBruce Momjian2006-07-06 02:12:32 +0000
committerBruce Momjian2006-07-06 02:12:32 +0000
commit591e90a4d9dd5698dd5fd01d0d8620233c326da4 (patch)
tree8d907037b2804a787dfdaf07952c2ca1ebe328e1 /src/include/getaddrinfo.h
parenta7aa0b818970579238e1424a81363eeb3c0b358c (diff)
WIN32 fixes:
I take out patch for this as a promise. This is client-build support of MS-VC6+. Fix for different getaddrinfo structure ordering on Win32 for IPv6. Hiroshi Saito
Diffstat (limited to 'src/include/getaddrinfo.h')
-rw-r--r--src/include/getaddrinfo.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/include/getaddrinfo.h b/src/include/getaddrinfo.h
index 6393ccfeae..ee60b71d84 100644
--- a/src/include/getaddrinfo.h
+++ b/src/include/getaddrinfo.h
@@ -15,7 +15,7 @@
*
* Copyright (c) 2003-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.20 2006/06/07 22:24:45 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.21 2006/07/06 02:12:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -41,7 +41,9 @@
#define EAI_SYSTEM (-11)
#else /* WIN32 */
#ifdef WIN32_ONLY_COMPILER
+#ifndef WSA_NOT_ENOUGH_MEMORY
#define WSA_NOT_ENOUGH_MEMORY (WSAENOBUFS)
+#endif
#define WSATYPE_NOT_FOUND (WSABASEERR+109)
#endif
#define EAI_AGAIN WSATRY_AGAIN
@@ -89,6 +91,7 @@
#ifndef HAVE_STRUCT_ADDRINFO
+#ifndef WIN32
struct addrinfo
{
int ai_flags;
@@ -100,6 +103,24 @@ struct addrinfo
char *ai_canonname;
struct addrinfo *ai_next;
};
+#else
+/*
+ * The order of the structure elements on Win32 doesn't match the
+ * order specified in the standard, but we have to match it for
+ * IPv6 to work.
+ */
+struct addrinfo
+{
+ int ai_flags;
+ int ai_family;
+ int ai_socktype;
+ int ai_protocol;
+ size_t ai_addrlen;
+ char *ai_canonname;
+ struct sockaddr *ai_addr;
+ struct addrinfo *ai_next;
+};
+#endif
#endif /* HAVE_STRUCT_ADDRINFO */