Re: [HACKERS] Proposed patch to getaddrinfo.c to support - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: [HACKERS] Proposed patch to getaddrinfo.c to support
Date
Msg-id 430E4E29.6090705@dunslane.net
Whole thread Raw
In response to Re: [HACKERS] Proposed patch to getaddrinfo.c to support  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Proposed patch to getaddrinfo.c to support  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [HACKERS] Proposed patch to getaddrinfo.c to support  (Petr Jelinek <pjmodos@seznam.cz>)
List pgsql-patches

Tom Lane wrote:

>Petr Jelinek <pjmodos@seznam.cz> writes:
>
>
>>Yep those changes proposed in my previous email fixes IPv4 too.
>>
>>
>
>Apparently not on loris (unless there was another patch that I missed).
>Maybe something to do with a different version of Windows?
>
>
>
>

I suspected we'd forgotten something.

The attached small patch appears to be what's required (at least on
loris).  "make check" failed but not for any apparent ipv6 reason. More
importantly, we correctly set HAVE_IPV6 and HAVE_STRUCT_ADDRINFO.

cheers

andrew
Index: src/include/port/win32/sys/socket.h
===================================================================
RCS file: /projects/cvsroot/pgsql/src/include/port/win32/sys/socket.h,v
retrieving revision 1.2
diff -c -r1.2 socket.h
*** src/include/port/win32/sys/socket.h    4 Aug 2003 00:43:32 -0000    1.2
--- src/include/port/win32/sys/socket.h    25 Aug 2005 22:55:39 -0000
***************
*** 5,10 ****
--- 5,11 ----
   *
   * Note: Don't include <wingdi.h> directly.  It causes compile errors.
   */
+ #include <ws2tcpip.h>
  #include <winsock2.h>
  #undef ERROR
  #undef small
***************
*** 13,16 ****
--- 14,24 ----
  #ifdef PGERROR
  #define ERROR PGERROR

+ /*
+  * 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

pgsql-patches by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: CRC32 function
Next
From: "Chuck McDevitt"
Date:
Subject: Re: [HACKERS] Proposed patch to getaddrinfo.c to support