Skip to content

Commit 57ba3df

Browse files
mhdawsonvmoroz
andauthored
Update ci-win.yml (#1503)
* Update ci-win.yml * fix building with C++20 in MSVC * don't cancel other jobs when one job fails --------- Co-authored-by: Vladimir Morozov <[email protected]>
1 parent 7c79c33 commit 57ba3df

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/ci-win.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ jobs:
1313
timeout-minutes: 30
1414
strategy:
1515
matrix:
16-
node-version: [ 18.x, 20.x, 21.x ]
16+
node-version: [ 18.x, 20.x, 21.x, 22.x ]
1717
architecture: [x64, x86]
1818
os:
1919
- windows-2019
2020
- windows-2022
21+
fail-fast: false # Don't cancel other jobs when one job fails
2122
runs-on: ${{ matrix.os }}
2223
steps:
2324
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

napi-inl.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ napi_value TemplatedCallback(napi_env env,
154154
napi_callback_info info) NAPI_NOEXCEPT {
155155
return details::WrapCallback([&] {
156156
CallbackInfo cbInfo(env, info);
157-
return Callback(cbInfo);
157+
// MSVC requires to copy 'Callback' function pointer to a local variable
158+
// before invoking it.
159+
auto callback = Callback;
160+
return callback(cbInfo);
158161
});
159162
}
160163

0 commit comments

Comments
 (0)