Re: msys inet_pton strangeness

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: msys inet_pton strangeness
Date: 2024-09-29 20:00:00
Message-ID: da25f8f7-e8b3-03f5-dd6d-1d5093a3da56@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

29.09.2024 18:47, Andrew Dunstan wrote:
> Yeah, src/include/port/win32/sys/socket.h has:
>
> #include <winsock2.h>
> #include <ws2tcpip.h>
> #include <windows.h>
>
> I'm inclined to think we might need to reverse the order of the last two. TBH I don't really understand how this has
> worked up to now.
>

As far as I can see, in my environment  _WIN32_WINNT defined with
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x603
#endif

inside C:/msys64/ucrt64/include/_mingw.h, which can be included
                 from C:/msys64/ucrt64/include/corecrt.h:10,
                 from C:/msys64/ucrt64/include/crtdefs.h:10,
                 from ../../../src/include/pg_config_os.h:40,
                 from ../../../src/include/c.h:56,
                 from ../../../src/include/postgres_fe.h:25,
                 from fe-secure-common.c:20

or (if HAVE_CRTDEFS_H is not defined):
                 from C:/msys64/ucrt64/include/corecrt.h:10,
                 from C:/msys64/ucrt64/include/corecrt_stdio_config.h:10,
                 from C:/msys64/ucrt64/include/stdio.h:9,
                 from ../../../src/include/c.h:59,
                 from ../../../src/include/postgres_fe.h:25,
                 from fe-secure-common.c:20

or (if winsock2.h included directly):
                 from C:/msys64/ucrt64/include/windows.h:9,
                 from C:/msys64/ucrt64/include/winsock2.h:23

so including winsock2.h is sufficient to include _mingw.h, but it doesn't
redefine _WIN32_WINNT, unfortunately.

Best regards,
Alexander

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-09-29 20:11:23 Re: Fixing backslash dot for COPY FROM...CSV
Previous Message Michał Kłeczek 2024-09-29 18:49:31 SET or STRICT modifiers on function affect planner row estimates