Re: C11 / VS 2019 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: C11 / VS 2019
Date
Msg-id ciaabgt4vy7d35y6ei7s244zinffg4dgyhbu2vsrwdmdgalxl4@qd5lzywiycc4
Whole thread Raw
In response to Re: C11 / VS 2019  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2025-07-09 16:10:25 -0400, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
> >     /*
> >     To turn off/hide the contents of this file:
> >       #define
> >     MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS 0
> >     */
> 
> > I don't think we have any other VS 2019 machines in the buildfarm. I can 
> > try installing VS 2022, which hamerkop seems to be running without 
> > producing the error.
> 
> That would amount to desupporting VS 2019, which I'm not sure we want
> to do yet.  I don't have a huge problem with ignoring this warning.

FWIW, my understanding is that headers like winbase.h aren't part of the
compiler but part of the "SDK". And there are SDKs targetting different OS
versions, and different versions can be installed for the same or different
compiler versions.  So it's quite possible that this is a question of the
target SDK version, rather than the OS version.

hamerkop:
C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um\\windows.h

drongo:
C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\um\\windows.h


And with that trail, I found
  https://developer.microsoft.com/en-us/windows/downloads/windows-SDK/

which says, about Windows 10 SDK, Version 2104:

    SDK headers have been updated to address errors when compiling using the
    standard-conformant C preprocessor in the MSVC compiler cl.exe
    (/Zc:preprocessor, introduced in VS 2019 v16.6).

Which seems likely to describe precisely what we're seeing?

Greetings,

Andres Freund

PS: Wonder if we should make the SDK version visible in meson setup...



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: C11 / VS 2019
Next
From: Hari Krishna Sunder
Date:
Subject: Re: Should TRUNCATE fire DDL triggers