libmraa: support node.js v12

Maintainer: @blogic me
Compile tested: head r14241-ba2ddba, x86_64
Run tested: x86_64 (VirtualBox)

Description:
Addressed the build failure with node.js version 12.
Re-enable swig.

https://github.com/openwrt/packages/issues/11977
https://github.com/openwrt/packages/pull/12225

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
This commit is contained in:
Hirokazu MORIKAWA
2020-08-25 17:39:31 +09:00
parent 786253f214
commit 0e9db80f0e
2 changed files with 17 additions and 4 deletions
@@ -0,0 +1,14 @@
--- a/api/mraa/gpio.hpp
+++ b/api/mraa/gpio.hpp
@@ -175,7 +175,11 @@
v8::Local<v8::Value> argv[] = { SWIGV8_INTEGER_NEW(-1) };
#if NODE_MODULE_VERSION >= 0x000D
v8::Local<v8::Function> f = v8::Local<v8::Function>::New(v8::Isolate::GetCurrent(), This->m_v8isr);
+#if NODE_MODULE_VERSION >= 72
+ f->Call(SWIGV8_CURRENT_CONTEXT(), SWIGV8_CURRENT_CONTEXT()->Global(), argc, argv);
+#else
f->Call(SWIGV8_CURRENT_CONTEXT()->Global(), argc, argv);
+#endif
#else
This->m_v8isr->Call(SWIGV8_CURRENT_CONTEXT()->Global(), argc, argv);
#endif