Skip to content

Commit 61ee101

Browse files
authored
Merge branch 'master' into patch-5
2 parents 5388d2e + fb1f739 commit 61ee101

26 files changed

Lines changed: 1226 additions & 311 deletions

‎.github/actions/setup-llvm-mingw/action.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ runs:
1919
- name: Cache llvm-mingw (Windows)
2020
id: cache-llvm
2121
if: runner.os == 'Windows'
22-
uses: actions/cache@v4
22+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
2323
with:
2424
path: .llvm-mingw
2525
key: llvm-mingw-${{ runner.os }}-${{ inputs.llvm-mingw-version }}-${{ inputs.host-arch }}
@@ -50,7 +50,7 @@ runs:
5050
- name: Cache llvm-mingw (Linux)
5151
id: cache-llvm-linux
5252
if: runner.os == 'Linux'
53-
uses: actions/cache@v4
53+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
5454
with:
5555
path: /opt/llvm-mingw
5656
key: llvm-mingw-${{ runner.os }}-${{ inputs.llvm-mingw-version }}-${{ inputs.host-arch }}

‎.github/actions/setup-llvm-msvc/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ runs:
1414
steps:
1515
- name: Cache LLVM and tools
1616
id: cache-llvm
17-
uses: actions/cache@v4
17+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
1818
with:
1919
path: |
2020
.LLVM

‎.github/dependabot.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ updates:
88
directory: "/"
99
schedule:
1010
interval: "daily"
11+
cooldown:
12+
default-days: 7

‎.github/workflows/check-line-endings.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Enforce .gitattributes line endings
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v7
14+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1515

1616
- name: Check for line ending violations
1717
run: |

‎.github/workflows/ci.yml‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
config: Release
2727
runs-on: ${{ matrix.toolchain.image }}
2828
steps:
29-
- uses: actions/checkout@v7
29+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3030

3131
- name: Download nuget
3232
run: |
@@ -71,7 +71,7 @@ jobs:
7171
cmd /c "$env:VSDevCmd" "&" msbuild /m /clp:ForceConsoleColor "$env:msbuild_config_props" cppwinrt.sln /t:cppwinrt
7272
7373
- name: Upload built executables
74-
uses: actions/upload-artifact@v7
74+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
7575
with:
7676
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
7777
path: |
@@ -113,18 +113,18 @@ jobs:
113113
test_exe: test_cpp20_module
114114
runs-on: ${{ matrix.toolchain.image }}
115115
steps:
116-
- uses: actions/checkout@v7
116+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
117117

118118
- name: Fetch cppwinrt executables
119119
if: matrix.arch != 'arm64'
120-
uses: actions/download-artifact@v8
120+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
121121
with:
122122
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
123123
path: _build/${{ matrix.arch }}/${{ matrix.config }}/
124124

125125
- name: Fetch x86 cppwinrt executables (arm64 only)
126126
if: matrix.arch == 'arm64'
127-
uses: actions/download-artifact@v8
127+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
128128
with:
129129
name: msvc-build-${{ matrix.compiler}}-x86-Release-${{ matrix.toolchain.platform_toolset }}-bin
130130
path: _build/x86/Release/
@@ -243,7 +243,7 @@ jobs:
243243
244244
- name: Upload arm64 test executables
245245
if: matrix.arch == 'arm64'
246-
uses: actions/upload-artifact@v7
246+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
247247
with:
248248
name: msvc-tests-${{ matrix.test_exe }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
249249
path: |
@@ -263,7 +263,7 @@ jobs:
263263
CMAKE_COLOR_DIAGNOSTICS: 1
264264
CLICOLOR_FORCE: 1
265265
steps:
266-
- uses: actions/checkout@v7
266+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
267267

268268
- name: Install cross compiler
269269
run: |
@@ -282,7 +282,7 @@ jobs:
282282
cmake --build build/cross_x64/ --target install -j2
283283
284284
- name: Upload cppwinrt.exe
285-
uses: actions/upload-artifact@v7
285+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
286286
with:
287287
name: cross-build-${{ matrix.arch }}-bin
288288
path: install/bin/cppwinrt.exe
@@ -296,7 +296,7 @@ jobs:
296296
Deployment: [Component, Standalone]
297297
runs-on: windows-2025-vs2026
298298
steps:
299-
- uses: actions/checkout@v7
299+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
300300

301301
- name: Download nuget
302302
run: |
@@ -339,10 +339,10 @@ jobs:
339339
platform_toolset: v145
340340
runs-on: ${{ matrix.toolchain.image }}
341341
steps:
342-
- uses: actions/checkout@v7
342+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
343343

344344
- name: Fetch cppwinrt executables
345-
uses: actions/download-artifact@v8
345+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
346346
with:
347347
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
348348
path: _build/${{ matrix.arch }}/${{ matrix.config }}/
@@ -384,7 +384,7 @@ jobs:
384384
name: Build nuget package with MSVC
385385
runs-on: windows-2025-vs2026
386386
steps:
387-
- uses: actions/checkout@v7
387+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
388388

389389
- name: Package
390390
run: |
@@ -399,7 +399,7 @@ jobs:
399399
}
400400
401401
- name: Upload nuget package artifact
402-
uses: actions/upload-artifact@v7
402+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
403403
with:
404404
name: package
405405
path: "*.nupkg"

‎cppwinrt/code_writers.h‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,17 @@ namespace cppwinrt
226226
return { w, write_close_namespace };
227227
}
228228

229+
[[nodiscard]] static finish_with wrap_type_namespace_without_export(writer& w, std::string_view const& ns)
230+
{
231+
auto format = R"(namespace winrt::@
232+
{
233+
)";
234+
235+
w.write(format, ns);
236+
237+
return { w, write_close_namespace };
238+
}
239+
229240
static void write_enum_field(writer& w, Field const& field)
230241
{
231242
auto format = R"( % = %,
@@ -1464,24 +1475,36 @@ namespace cppwinrt
14641475
else if (type_name == "Windows.Foundation.IAsyncAction")
14651476
{
14661477
w.write(R"( auto get() const;
1478+
// Synchronously waits without asserting that the calling thread is not an STA.
1479+
// Use only when the STA is not presenting UI and blocking is known to be safe.
1480+
auto get_unchecked() const;
14671481
auto wait_for(Windows::Foundation::TimeSpan const& timeout) const;
14681482
)");
14691483
}
14701484
else if (type_name == "Windows.Foundation.IAsyncOperation`1")
14711485
{
14721486
w.write(R"( auto get() const;
1487+
// Synchronously waits without asserting that the calling thread is not an STA.
1488+
// Use only when the STA is not presenting UI and blocking is known to be safe.
1489+
auto get_unchecked() const;
14731490
auto wait_for(Windows::Foundation::TimeSpan const& timeout) const;
14741491
)");
14751492
}
14761493
else if (type_name == "Windows.Foundation.IAsyncActionWithProgress`1")
14771494
{
14781495
w.write(R"( auto get() const;
1496+
// Synchronously waits without asserting that the calling thread is not an STA.
1497+
// Use only when the STA is not presenting UI and blocking is known to be safe.
1498+
auto get_unchecked() const;
14791499
auto wait_for(Windows::Foundation::TimeSpan const& timeout) const;
14801500
)");
14811501
}
14821502
else if (type_name == "Windows.Foundation.IAsyncOperationWithProgress`2")
14831503
{
14841504
w.write(R"( auto get() const;
1505+
// Synchronously waits without asserting that the calling thread is not an STA.
1506+
// Use only when the STA is not presenting UI and blocking is known to be safe.
1507+
auto get_unchecked() const;
14851508
auto wait_for(Windows::Foundation::TimeSpan const& timeout) const;
14861509
)");
14871510
}

‎cppwinrt/component_writers.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ catch (...) { return winrt::to_hresult(); }
400400
return;
401401
}
402402

403-
auto wrap_type = wrap_type_namespace(w, type_namespace);
403+
auto wrap_type = wrap_type_namespace_without_export(w, type_namespace);
404404

405405
for (auto&&[factory_name, factory] : get_factories(w, type))
406406
{

0 commit comments

Comments
 (0)