forked from vkurchatkin/deasync
-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
537bb6f
commit 0901c8e
Showing
4 changed files
with
27 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
{ | ||
"targets": [{ | ||
"target_name": "deasync", | ||
"cflags!": [ "-fno-exceptions" ], | ||
"cflags_cc!": [ "-fno-exceptions" ], | ||
"xcode_settings": { "GCC_ENABLE_CPP_EXCEPTIONS": "YES", | ||
"CLANG_CXX_LIBRARY": "libc++", | ||
"MACOSX_DEPLOYMENT_TARGET": "10.7", | ||
}, | ||
"msvs_settings": { | ||
"VCCLCompilerTool": { "ExceptionHandling": 1 }, | ||
}, | ||
"sources": [ | ||
"src/deasync.cc" | ||
], | ||
"include_dirs": [ | ||
"<!(node -e \"require('nan')\")" | ||
"<!@(node -p \"require('node-addon-api').include\")", | ||
] | ||
}] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
#include <uv.h> | ||
#include <v8.h> | ||
#include <nan.h> | ||
#include <napi.h> | ||
#include <uv.h> | ||
|
||
using namespace v8; | ||
using namespace Napi; | ||
|
||
NAN_METHOD(Run) { | ||
Nan::HandleScope scope; | ||
Napi::Value Run(const Napi::CallbackInfo& info) { | ||
Napi::Env env = info.Env(); | ||
Napi::HandleScope scope(env); | ||
uv_run(uv_default_loop(), UV_RUN_ONCE); | ||
info.GetReturnValue().Set(Nan::Undefined()); | ||
return env.Undefined(); | ||
} | ||
|
||
static NAN_MODULE_INIT(init) { | ||
Nan::Set(target, Nan::New("run").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(Run)).ToLocalChecked()); | ||
static Napi::Object init(Napi::Env env, Napi::Object exports) { | ||
exports.Set(Napi::String::New(env, "run"), Napi::Function::New(env, Run)); | ||
return exports; | ||
} | ||
|
||
NODE_MODULE(deasync, init) | ||
NODE_API_MODULE(deasync, init) |