Bug: Unexported `extern "C"` block in `base.h` makes `WINRT_IMPL_*` declarations invisible to downstream modules
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- cpp
- 領域
- build-system
調査の方向性
Start with the first extern "C" block in base.h and the references in Windows.Foundation.h from wait_for_completed and when_any; the issue identifies winrt.Windows.Foundation.ixx as a place where Clang reports the visibility error. Check how winrt_base exports declarations used by downstream modules, then build the module with Clang to confirm the reported failure is resolved.
索引モデルが issue の本文から書いたものです。
説明
Version
3.0.260818.1
Summary
In module builds, base.h is included in the module purview of winrt_base, and winrt.Windows.Foundation gets its base.h declarations via export import winrt_base;.
The first extern "C" block in base.h (declaring WINRT_IMPL_* functions) is not marked export. When Windows.Foundation.h calls WINRT_IMPL_CreateEventW, WINRT_IMPL_SetEvent, and WINRT_IMPL_WaitForSingleObject (in wait_for_completed and when_any), these functions are not visible to name lookup in winrt.Windows.Foundation.
extern "C" in a module purview only specifies C language linkage and global module ownership; it does not export the declarations. MSVC currently masks this bug by exposing unexported extern "C" declarations to importing modules, whereas Clang rejects winrt.Windows.Foundation.ixx with an undeclared/invisible identifier error.
Expected behavior
All declarations in winrt_base that are referenced by downstream namespace modules or generated component files (module.g.cpp) should either be explicitly exported (WINRT_EXPORT / export extern "C") or placed in a shared header included in the global module fragment.
Actual behavior
No response
Additional comments
A few related module-visibility mismatches stem from the same pattern in module builds:
1. Missing <intrin.h> in winrt.Windows.Foundation.ixx: <intrin.h> is only included in the global module fragments of winrt_base.ixx and winrt_numerics.ixx, but strings/base_coroutine_foundation.h (winrt::when_any) directly calls _InterlockedCompareExchangePointer inside winrt.Windows.Foundation.
2. Inconsistent linkage/export specifiers on namespace std specializations:
- strings/base_std_hash.h, strings/base_coroutine_threadpool.h, and strings/base_coroutine_foundation.h use WINRT_IMPL_STD_EXPORT namespace std (extern "C++" without export).
- strings/base_collections_map.h uses WINRT_EXPORT namespace std (export extern "C++").
- strings/base_string.h, strings/base_stringable_format.h, strings/base_stringable_format_1.h, and wrap_std_namespace in cppwinrt/code_writers.h declare std::hash and std::formatter specializations inside the module purview without extern "C++" or export, attaching std specializations to named modules.
- 主要言語
- C++
- スター
- 1.9k
- フォーク
- 288
- 平均マージ
- 18時間 15分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/cppwinrt のほかの issue
-
Bug: Missing `<intrin.h>` in `winrt.Windows.Foundation.ixx` in module builds対応中かも @YexuanXiao が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/cppwinrt#1646 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/cppwinrt#1554 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Bug: Standard library headers included inside module purview of `winrt_numerics.ixx`対応中かも @YexuanXiao が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
microsoft/cppwinrt#1647 · コメント 17 件 ·
メンテナーはふだん 1 日以内に返信
-
base_macros.h disables warnings without push/pop, leaking them into consumer translation units対応中かも @DanielJump が 64 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 20/100
メンテナーはふだん 1 日以内に返信
-
Bug: headers cannot be compiled at high warning levels (MSVC /Wall, clang)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
microsoft/cppwinrt#1620 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
microsoft/cppwinrt の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
-
[XLA] hlo/pass/README.md says passes implement Run; since the NVI change they implement RunImplオープン
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA-RTX/NRI#312 ·
メンテナーはふだん 1 日以内に返信
-
permute_q_b_proj / permute_wv_proj accept scale factors from another device対応中かも @0z5a が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
deepseek-ai/FlashMLA#247 ·
メンテナーはふだん 1 日以内に返信
-
Linux npm packaging leaves workspace files that block subsequent CI checkout対応中かも @Spockkk0225 が今日担当しました。 オープンci
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
alibaba/neug#1195 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信