Skip to content

Commit

Permalink
Update ci-win.yml (#1503)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
mhdawson and vmoroz committed May 27, 2024
1 parent 7c79c33 commit 57ba3df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
node-version: [ 18.x, 20.x, 21.x ]
node-version: [ 18.x, 20.x, 21.x, 22.x ]
architecture: [x64, x86]
os:
- windows-2019
- windows-2022
fail-fast: false # Don't cancel other jobs when one job fails
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
Expand Down
5 changes: 4 additions & 1 deletion napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ napi_value TemplatedCallback(napi_env env,
napi_callback_info info) NAPI_NOEXCEPT {
return details::WrapCallback([&] {
CallbackInfo cbInfo(env, info);
return Callback(cbInfo);
// MSVC requires to copy 'Callback' function pointer to a local variable
// before invoking it.
auto callback = Callback;
return callback(cbInfo);
});
}

Expand Down

0 comments on commit 57ba3df

Please sign in to comment.