Skip to content

Avoid using intrinsics in Windows.Foundation.ixx - #1649

Open
Yexuan Xiao (YexuanXiao) wants to merge 1 commit into
microsoft:masterfrom
YexuanXiao:avoid-intrin-upstream
Open

Yexuan Xiao (YexuanXiao) wants to merge 1 commit into
microsoft:masterfrom
YexuanXiao:avoid-intrin-upstream

Conversation

@YexuanXiao

@YexuanXiao Yexuan Xiao (YexuanXiao) commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fix #1646.

Windows.Foundation.h currently uses _InterlockedCompareExchangePointer but does not include the required header, which causes GCC and GNU mode Clang builds to fail. MSVC mode Clang treats _InterlockedCompareExchangePointer as a built-in intrinsic and does not need to include intrin.h, while MSVC, due to the bug, incorrectly accessed a declaration that should have been invisible.

Rather than modifying the generator to include intrin.h, it would be better to use C++20's std::atomic_ref to avoid this issue.

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.

Bug: Missing <intrin.h> in winrt.Windows.Foundation.ixx in module builds

1 participant