Skip to content

fix: match the MSVC 14.38 shared mutex declarations - #8125

Open
lucas-tafuri wants to merge 1 commit into
ItsNotRexed:mainfrom
lucas-tafuri:fix/msvc-1438-shared-mutex-signatures
Open

lucas-tafuri wants to merge 1 commit into
ItsNotRexed:mainfrom
lucas-tafuri:fix/msvc-1438-shared-mutex-signatures

Conversation

@lucas-tafuri

Copy link
Copy Markdown
Contributor

MSVC 14.38 declares the six _Smtx_* functions in xthreads.h without noexcept. The CRT shim spells all six noexcept, which gives C2382 while compiling dynamic CRT targets. Match the native 14.38 declarations and retain the existing exception specification for other toolsets.

Claimed in #8047. This follows the 14.38 reproduction on #7146. A successful 14.38 /MD build needs both patches. #7146 resolves the separate _Cnd_timedwait declaration error.

Verified on Windows 11 x64, RelWithDebInfo /MD, with the pinned Khronos Vulkan headers and an RTX 3090.

Synthetic tests only. Wine was outside this verification. AI-assisted (OpenAI Codex).

Added noexcept specifier to shared-mutex functions for compatibility with MSVC 14.38.

@loyrox loyrox left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 9707d8d on NVIDIA GeForce RTX 3060 (driver 621.14 / 32.0.16.2114, Vulkan 1.4.357), Windows 11 10.0.26200, MSVC 19.51.36260 (VS 2026), CMake 4.2, RelWithDebInfo, -DLEONIDA_VULKAN_HEADERS_FETCH=ON: pass.

  • Clean build with a toolset newer than the two in the description (_MSC_VER 1951, so noexcept is kept): no C2382.
  • crt_timed_wait and vk_queue pass.
  • Full ctest: 235/237, identical to main dde82f2 on the same machine. The two failures are the same on main and unrelated to this PR: d3d12_vulkan_device line 6574 tiles == 1 and d3d12_depth_resolve (refused resolves report "destination changed"), both already listed in #8426.

@Kerwinss

Copy link
Copy Markdown

Tested 9707d8d on Windows 11 Pro 10.0.26300, MSVC 14.51 (VS Build Tools 2026), Windows SDK 10.0.26100, NVIDIA GeForce RTX 4060 / 621.24, Khronos Vulkan headers via -DLEONIDA_VULKAN_HEADERS_FETCH=ON (no glslangValidator): pass, no regression.

Merged onto main dde82f2 (clean), full runtime build, ctest -C RelWithDebInfo -j6: 235/237. The two failures are the ones main has on this GPU: d3d12_depth_resolve (#7985) and d3d12_vulkan_device:6574 (claimed by iTzAlvar). crt_timed_wait passes. This only covers the noexcept side: MSVC 14.51's xthreads.h declares _Smtx_lock_exclusive(_Smtx_t*) noexcept, and the shim still compiles cleanly against it. I have no 14.38 toolset here.

Question: the guard is _MSC_VER == 1938 exactly. Do you know whether 14.37 or 14.39 declare these without noexcept too?

AI-assisted (Claude Code). No game files.

@lucas-tafuri

Copy link
Copy Markdown
Contributor Author

I checked Microsoft’s published xthreads.h for both toolsets. VS 2022 17.7 / MSVC 14.37 declares all six _Smtx_* functions without noexcept, like 14.38. VS 2022 17.9 / MSVC 14.39 declares all six with noexcept. The exact guard in this PR reflects the native build I verified. The published declarations suggest 14.37 needs the same _Smtx_* treatment. I have not run a full 14.37 build. AI-assisted (OpenAI Codex).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants