Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "non-context-aware" error for Electron #300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Using NAN_MODULE_WORKER_ENABLED for context
Replaced NODE_MODULE with NAN_MODULE_WORKER_ENABLED to fix issues with the latest electron releases.
SomeRanDev authored Sep 2, 2021
commit 5fd26dc09ca250e2f75f1a11012715742db96fb3
18 changes: 12 additions & 6 deletions src/greenworks_api.cc
Original file line number Diff line number Diff line change
@@ -52,22 +52,28 @@ NAN_MODULE_INIT(init) {

} // namespace

#if NODE_MAJOR_VERSION >= 10
#define GREENWORKS_DEFINE_MODULE NAN_MODULE_WORKER_ENABLED
#else
#define GREENWORKS_DEFINE_MODULE NODE_MODULE
#endif

#if defined(_WIN32)
#if defined(_M_IX86)
NODE_MODULE(greenworks_win32, init)
GREENWORKS_DEFINE_MODULE(greenworks_win32, init)
#elif defined(_M_AMD64)
NODE_MODULE(greenworks_win64, init)
GREENWORKS_DEFINE_MODULE(greenworks_win64, init)
#endif
#elif defined(__APPLE__)
#if defined(__x86_64__) || defined(__ppc64__)
NODE_MODULE(greenworks_osx64, init)
GREENWORKS_DEFINE_MODULE(greenworks_osx64, init)
#else
NODE_MODULE(greenworks_osx32, init)
GREENWORKS_DEFINE_MODULE(greenworks_osx32, init)
#endif
#elif defined(__linux__)
#if defined(__x86_64__) || defined(__ppc64__)
NODE_MODULE(greenworks_linux64, init)
GREENWORKS_DEFINE_MODULE(greenworks_linux64, init)
#else
NODE_MODULE(greenworks_linux32, init)
GREENWORKS_DEFINE_MODULE(greenworks_linux32, init)
#endif
#endif