From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@postgreSQL.org
Subject: _WINSOCK_DEPRECATED_NO_WARNINGS
Date: Thu, 16 Nov 2017 11:37:05 -0500
Message-ID: <20124.1510850225@sss.pgh.pa.us> (raw)
Checking the buildfarm to see if ed9b3606d broke anything, I notice
that woodlouse is producing stacks of warnings like this:
src/port/thread.c(134): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings [C:\buildfarm\buildenv\HEAD\pgsql.build\libpgport.vcxproj]
C:\Program Files (x86)\Windows Kits\8.1\Include\um\winsock2.h(2238) : see declaration of 'gethostbyname'
and was doing so before that commit, so it's not my fault :-)
win32.h has
* Also for VS2015, add a define that stops compiler complaints about
* using the old Winsock API.
*/
#if defined(_MSC_VER) && _MSC_VER >= 1900
#define _WINSOCK_DEPRECATED_NO_WARNINGS
but evidently it chose the wrong cutoff for when to enable that
symbol, because woodlouse is (or claims to be) running VS2013.
Is there any good reason not to just define
_WINSOCK_DEPRECATED_NO_WARNINGS unconditionally? Presumably
it would have no effect on VS versions too old to know the symbol.
I'm a bit inclined to move it to win32_port.h, as well,
since that's what includes <winsock2.h>.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: _WINSOCK_DEPRECATED_NO_WARNINGS
In-Reply-To: <20124.1510850225@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox