[SERVER-79655] missing winnt.h include in platform/pause.h Created: 03/Aug/23 Updated: 08/Aug/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | Backlog - Service Architecture |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Service Arch
|
||||||||
| Participants: | |||||||||
| Description |
|
I went to use this macro and couldn't figure out how to get it to work. It doesn't include any headers, so the compiler reports that the reference to YieldProcessor is invalid.
I've tried a few things. This yields a #error complaint that there's "no target architecture". It looks like this could be due to missing windows.h? So I #include <windows.h> above <winnt.h> and then lots of code fails to compile due to usage of min() and max(), etc. Someone with more Windows experience could figure this out. |
| Comments |
| Comment by Billy Donahue [ 03/Aug/23 ] |
|
There's a /FImongo/platform/basic.h in the failed command, so I'm surprised by this failure. That header looks like it should be setting up the whole Win32 API. [2023/08/03 03:49:24.618] cl /Fobuild\cached\mongo\db\process_health\dns_health_observer.obj /c src\mongo\db\process_health\dns_health_observer.cpp /TP /nologo /WX /FImongo/platform/basic.h /fp:strict /EHsc /W3 /wd4068 /wd4244 /wd4267 /wd4290 /wd4351 /wd4355 /wd4373 /wd4800 /wd4251 /wd4291 /we4013 /we4099 /we4930 /errorReport:none /MD /O2 /Oy- /bigobj /utf-8 /permissive- /Zc:__cplusplus /Zc:sizedDealloc /volatile:iso /diagnostics:caret /std:c++20 /Gw /Gy /Zc:inline /DSAFEINT_USE_INTRINSICS=0 /DPCRE2_STATIC /DNDEBUG /DBOOST_ALL_NO_LIB /D_UNICODE /DUNICODE /D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING /D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING /D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING /D_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS /D_CONSOLE /D_CRT_SECURE_NO_WARNINGS /D_ENABLE_EXTENDED_ALIGNED_STORAGE /D_SCL_SECURE_NO_WARNINGS /D_WIN32_WINNT=0x0A00 /DBOOST_USE_WINAPI_VERSION=0x0A00 /DNTDDI_VERSION=0x0A000000 /DABSL_FORCE_ALIGNED_ACCESS /DBOOST_ENABLE_ASSERT_DEBUG_HANDLER /DBOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF /DBOOST_LOG_NO_SHORTHAND_NAMES /DBOOST_LOG_USE_NATIVE_SYSLOG /DBOOST_LOG_WITHOUT_THREAD_ATTR /DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS /DBOOST_SYSTEM_NO_DEPRECATED /DBOOST_THREAD_USES_DATETIME /DBOOST_THREAD_VERSION=5 /Isrc\third_party\s2 /Isrc\third_party\libstemmer_c\include /Isrc\third_party\SafeInt /Isrc\third_party\murmurhash3 /Isrc\third_party\immer\dist /Isrc\third_party\fmt\dist\include /Isrc\third_party\boost /Isrc\third_party\abseil-cpp\dist /IC:\sasl\include /Ibuild\cached /Isrc /Z7 |