Re: _WINSOCK_DEPRECATED_NO_WARNINGS

Поиск
Список
Период
Сортировка
От Glen Knowles
Тема Re: _WINSOCK_DEPRECATED_NO_WARNINGS
Дата
Msg-id CAJCH0yD6bP_qGxawjawWNCJdrL1ncg-Yfey7TCYWfsFTYvdBbA@mail.gmail.com
обсуждение исходный текст
Ответ на _WINSOCK_DEPRECATED_NO_WARNINGS  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: _WINSOCK_DEPRECATED_NO_WARNINGS
Список pgsql-hackers
On Thu, Nov 16, 2017 at 8:37 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
 * 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.


It's actually checking the wrong thing, the problem is the version of the Windows SDK, and while the one installed by default with VS2015 might be the right place to cutoff it's not uncommon to have multiple versions of the SDK (and VS) in various combinations.

To check against the SDK you'd need something like:
#include <ntverp.h>
#if VER_PRODUCTBUILD >= 8100
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#endif
 
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.
 
Or you could just define it unconditionally. :)
 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] Refactoring identifier checks to consistently use strcmp
Следующее
От: Fabrízio de Royes Mello
Дата:
Сообщение: Re: [HACKERS] [PATCH] A hook for session start