You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules.md
+4-8Lines changed: 4 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ The NuGet targets automatically:
76
76
| Property | Type | Default | Description |
77
77
|----------|------|---------|-------------|
78
78
|`CppWinRTModule`| bool |`false`| Enable C++20 module mode. Adds `winrt.ixx` to compilation, folds component projections into the module, and passes `-module` to cppwinrt.exe for component generation. |
79
-
|`BuildStlModules`| ClCompile metadata |`false`| Enables building `std.ixx`/`std.compat.ixx` so `import std;` works. Set inside `<ItemDefinitionGroup><ClCompile>`. |
79
+
|`BuildStlModules`| ClCompile metadata |`false`| Enables building `std.ixx`/`std.compat.ixx` so `import std;` works. Set inside `<ItemDefinitionGroup><ClCompile>`. This is the same project property set by "Build ISO C++23 Standard Library Modules" (https://learn.microsoft.com/en-us/cpp/build/reference/c-cpp-prop-page?view=msvc-180#cc-language-properties)|
80
80
81
81
When `CppWinRTModule=true`, the NuGet targets also automatically:
82
82
- Define `WINRT_IMPORT_STD` as a preprocessor definition when `BuildStlModules`
@@ -205,10 +205,8 @@ These are used by the code generator and should not be set directly by users:
205
205
206
206
| Macro | Purpose |
207
207
|-------|---------|
208
-
|`WINRT_IMPL_GLOBAL_MODULE_FRAGMENT`| Set by the generated `winrt.ixx` around the `base_includes` content in the global module fragment (before `export module winrt;`). Prevents `import std;` from being emitted in the global module fragment where `import` declarations are not permitted by the C++ standard. |
209
-
|`WINRT_IMPL_IMPORT_STD`| Internal flag set when `WINRT_IMPORT_STD`, `__cpp_lib_modules`, and not-in-global-fragment conditions are all met. Guards the `#include` fallback path. |
210
208
|`WINRT_IMPL_SKIP_INCLUDES`| When defined, generated namespace headers skip their cross-namespace `#include` dependencies (e.g., `#include "winrt/base.h"`, `#include "winrt/impl/Windows.Foundation.2.h"`). Used when those dependencies are already available from the `winrt` module. The component's own impl headers are never skipped. |
211
-
|`WINRT_EXPORT`| Expands to `export` inside `winrt.ixx` (module purview), empty in header mode. Used on namespace declarations so types are properly exported from the module. Defined in `base_macros.h` (as empty) for use in generated component files that operate alongside the module. |
209
+
|`WINRT_EXPORT`| Expands to `export` inside `winrt.ixx` (module purview), empty in header mode. Used on namespace declarations so types are properly exported from the module. Also applied to `winrt_to_hresult_handler` and related extern handler variables in `base_extern.h` for correct linkage when mixing modules and non-modules code in the same binary. Defined in `base_macros.h` (as empty) for use in generated component files that operate alongside the module. |
212
210
|`WINRT_IMPL_EMPTY_BASES`| MSVC `__declspec(empty_bases)` optimization. Defined in both `base.h` and `base_macros.h`. |
213
211
|`WINRT_IMPL_ABI_DECL`| Combines `WINRT_IMPL_NOVTABLE` and `WINRT_IMPL_PUBLIC` for ABI interface declarations. |
214
212
|`CPPWINRT_VERSION`| Version string for header compatibility checking. Defined in `base.h` and `base_macros.h`. |
@@ -238,10 +236,8 @@ winrt/
238
236
239
237
```
240
238
module; ← Global module fragment
241
-
#define WINRT_IMPL_GLOBAL_MODULE_FRAGMENT
242
-
<standard library includes> ← Raw #includes (import not allowed here)
243
-
<directxmath.h, intrin.h> ← Platform headers
244
-
#undef WINRT_IMPL_GLOBAL_MODULE_FRAGMENT
239
+
<intrin.h, version, directxmath.h> ← Platform includes (base_includes)
240
+
<algorithm, array, atomic, ...> ← Standard library includes (base_std_includes)
0 commit comments