Skip to content

Commit

Permalink
Use C++11 ABI on Node.js 18.x+ on Linux (#7)
Browse files Browse the repository at this point in the history
Fixes: #6
Refs: nodejs/node#36634
  • Loading branch information
addaleax authored Jun 20, 2022
1 parent d227274 commit 1e015a2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [15.x, 16.x, 17.x]
node-version: [15.x, 16.x, 17.x, 18.x]
exclude:
- os: windows-latest
node-version: 15.x
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"mocha": "^8.1.3",
"node-fetch": "^2.6.1",
"nyc": "^15.1.0",
"ts-node": "^9.0.0",
"ts-node": "^10.8.1",
"typescript": "^4.0.3"
},
"dependencies": {
Expand Down
4 changes: 3 additions & 1 deletion src/binding.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "node_version.h"

// Node.js published binary compatibility
#undef _GLIBCXX_USE_CXX11_ABI
#ifdef __arm__
#if defined(__arm__) || NODE_VERSION_AT_LEAST(18, 0, 0)
#define _GLIBCXX_USE_CXX11_ABI 1
#else
#define _GLIBCXX_USE_CXX11_ABI 0
Expand Down

0 comments on commit 1e015a2

Please sign in to comment.