Closed GerHobbelt closed 3 years ago
As stated: patched locally and closing this, since it's not a pthread issue per se, but rather a Windows SDK issue.
(You need local UAC admin rights to patch that SDK WinBase.h file, but I assume you have that or can get it. Anyway, it's obnoxious but not a showstopper and there's no cause for a work-around.)
When building the solution using MSVC2019 (tested on Visual Studio 2019, v16.9.5 and latest 16.9.6), every source file outputs this line in the Output window in Visual Studio.
Diagnosis and Fix
Upon investigation, this turns out to be a Microsoft Windows 10 SDK bug:
This is a bug in the Windows SDK which surfaces as a preprocessor warning when compiling in C17 mode, rather than "Legacy Mode", which we switched away from in commit 1357369867810838e6789ee3c964a0edea4564e9
Observe the bug in
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\WinBase.h
in this section: note the!defined(_WINBASE_)
in there in the result, which is where this preproceessor function WILL NOT WORK:and now here's the patched version, which does the proper thing - a lo, the issue goes away:
Apparently nobody at MS tested the SDK in C17 mode or this should have popped up as soon as you compile anything that includes WinBase.h one way or another. 🤷♀️
Filing it here so it can be found. Had a look at the doldrum that's MS bug reporting for devs and I don't like the wall at all:
I get it that you do that kind of thing to keep the loonies away and unload your team, but here's another team that doesn't need the hassle, so filing, patching locally and moving on. Google Search will decide, in the end.