src: fix build break from generic macro name
WRAP is too generic a macro name and causes the build to fail from conflicts. They have been prepended with NODE_.
This commit is contained in:
parent
5725864dfd
commit
35f789b027
@ -99,7 +99,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
FSEventWrap* wrap;
|
||||
UNWRAP(args.This(), FSEventWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), FSEventWrap, wrap);
|
||||
|
||||
if (args.Length() < 1 || !args[0]->IsString()) {
|
||||
return ThrowTypeError("Bad arguments");
|
||||
@ -173,7 +173,7 @@ void FSEventWrap::Close(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
FSEventWrap* wrap;
|
||||
UNWRAP_NO_ABORT(args.This(), FSEventWrap, wrap);
|
||||
NODE_UNWRAP_NO_ABORT(args.This(), FSEventWrap, wrap);
|
||||
|
||||
if (wrap == NULL || wrap->initialized_ == false) return;
|
||||
wrap->initialized_ = false;
|
||||
|
@ -42,7 +42,7 @@ void HandleWrap::Ref(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
HandleWrap* wrap;
|
||||
UNWRAP_NO_ABORT(args.This(), HandleWrap, wrap);
|
||||
NODE_UNWRAP_NO_ABORT(args.This(), HandleWrap, wrap);
|
||||
|
||||
if (wrap != NULL && wrap->handle__ != NULL) {
|
||||
uv_ref(wrap->handle__);
|
||||
@ -55,7 +55,7 @@ void HandleWrap::Unref(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
HandleWrap* wrap;
|
||||
UNWRAP_NO_ABORT(args.This(), HandleWrap, wrap);
|
||||
NODE_UNWRAP_NO_ABORT(args.This(), HandleWrap, wrap);
|
||||
|
||||
if (wrap != NULL && wrap->handle__ != NULL) {
|
||||
uv_unref(wrap->handle__);
|
||||
@ -68,7 +68,7 @@ void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
HandleWrap* wrap;
|
||||
UNWRAP(args.This(), HandleWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), HandleWrap, wrap);
|
||||
|
||||
// guard against uninitialized handle or double close
|
||||
if (wrap == NULL || wrap->handle__ == NULL) return;
|
||||
@ -95,7 +95,7 @@ HandleWrap::HandleWrap(Handle<Object> object, uv_handle_t* h) {
|
||||
HandleScope scope(node_isolate);
|
||||
assert(persistent().IsEmpty());
|
||||
persistent().Reset(node_isolate, object);
|
||||
WRAP(object, this);
|
||||
NODE_WRAP(object, this);
|
||||
QUEUE_INSERT_TAIL(&handle_wrap_queue, &handle_wrap_queue_);
|
||||
}
|
||||
|
||||
|
@ -760,7 +760,7 @@ void SecureContext::GetTicketKeys(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
SecureContext* wrap;
|
||||
UNWRAP(args.This(), SecureContext, wrap);
|
||||
NODE_UNWRAP(args.This(), SecureContext, wrap);
|
||||
|
||||
Local<Object> buff = Buffer::New(48);
|
||||
if (SSL_CTX_get_tlsext_ticket_keys(wrap->ctx_,
|
||||
@ -785,7 +785,7 @@ void SecureContext::SetTicketKeys(const FunctionCallbackInfo<Value>& args) {
|
||||
}
|
||||
|
||||
SecureContext* wrap;
|
||||
UNWRAP(args.This(), SecureContext, wrap);
|
||||
NODE_UNWRAP(args.This(), SecureContext, wrap);
|
||||
|
||||
if (SSL_CTX_set_tlsext_ticket_keys(wrap->ctx_,
|
||||
Buffer::Data(args[0]),
|
||||
|
@ -207,7 +207,7 @@ inline static void ThrowUVException(int errorno,
|
||||
|
||||
NO_RETURN void FatalError(const char* location, const char* message);
|
||||
|
||||
#define WRAP(Object, Pointer) \
|
||||
#define NODE_WRAP(Object, Pointer) \
|
||||
do { \
|
||||
assert(!Object.IsEmpty()); \
|
||||
assert(Object->InternalFieldCount() > 0); \
|
||||
@ -215,7 +215,7 @@ NO_RETURN void FatalError(const char* location, const char* message);
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define UNWRAP(Object, TypeName, Var) \
|
||||
#define NODE_UNWRAP(Object, TypeName, Var) \
|
||||
do { \
|
||||
assert(!Object.IsEmpty()); \
|
||||
assert(Object->InternalFieldCount() > 0); \
|
||||
@ -229,7 +229,7 @@ NO_RETURN void FatalError(const char* location, const char* message);
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define UNWRAP_NO_ABORT(Object, TypeName, Var) \
|
||||
#define NODE_UNWRAP_NO_ABORT(Object, TypeName, Var) \
|
||||
do { \
|
||||
assert(!Object.IsEmpty()); \
|
||||
assert(Object->InternalFieldCount() > 0); \
|
||||
|
@ -67,7 +67,7 @@ Local<Object> PipeWrap::Instantiate() {
|
||||
|
||||
PipeWrap* PipeWrap::Unwrap(Local<Object> obj) {
|
||||
PipeWrap* wrap;
|
||||
UNWRAP(obj, PipeWrap, wrap);
|
||||
NODE_UNWRAP(obj, PipeWrap, wrap);
|
||||
return wrap;
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ void PipeWrap::Bind(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
PipeWrap* wrap;
|
||||
UNWRAP(args.This(), PipeWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), PipeWrap, wrap);
|
||||
|
||||
String::AsciiValue name(args[0]);
|
||||
int err = uv_pipe_bind(&wrap->handle_, *name);
|
||||
@ -159,7 +159,7 @@ void PipeWrap::SetPendingInstances(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
PipeWrap* wrap;
|
||||
UNWRAP(args.This(), PipeWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), PipeWrap, wrap);
|
||||
|
||||
int instances = args[0]->Int32Value();
|
||||
|
||||
@ -172,7 +172,7 @@ void PipeWrap::Listen(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
PipeWrap* wrap;
|
||||
UNWRAP(args.This(), PipeWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), PipeWrap, wrap);
|
||||
|
||||
int backlog = args[0]->Int32Value();
|
||||
int err = uv_listen(reinterpret_cast<uv_stream_t*>(&wrap->handle_),
|
||||
@ -208,7 +208,7 @@ void PipeWrap::OnConnection(uv_stream_t* handle, int status) {
|
||||
|
||||
// Unwrap the client javascript object.
|
||||
PipeWrap* wrap;
|
||||
UNWRAP(client_obj, PipeWrap, wrap);
|
||||
NODE_UNWRAP(client_obj, PipeWrap, wrap);
|
||||
uv_stream_t* client_handle = reinterpret_cast<uv_stream_t*>(&wrap->handle_);
|
||||
if (uv_accept(handle, client_handle))
|
||||
return;
|
||||
@ -263,7 +263,7 @@ void PipeWrap::Open(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
PipeWrap* wrap;
|
||||
UNWRAP(args.This(), PipeWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), PipeWrap, wrap);
|
||||
|
||||
int fd = args[0]->IntegerValue();
|
||||
|
||||
@ -275,7 +275,7 @@ void PipeWrap::Connect(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
PipeWrap* wrap;
|
||||
UNWRAP(args.This(), PipeWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), PipeWrap, wrap);
|
||||
|
||||
assert(args[0]->IsObject());
|
||||
assert(args[1]->IsString());
|
||||
|
@ -129,7 +129,7 @@ class ProcessWrap : public HandleWrap {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
ProcessWrap* wrap;
|
||||
UNWRAP(args.This(), ProcessWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), ProcessWrap, wrap);
|
||||
|
||||
Local<Object> js_options = args[0]->ToObject();
|
||||
|
||||
@ -258,7 +258,7 @@ class ProcessWrap : public HandleWrap {
|
||||
static void Kill(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
ProcessWrap* wrap;
|
||||
UNWRAP(args.This(), ProcessWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), ProcessWrap, wrap);
|
||||
|
||||
int signal = args[0]->Int32Value();
|
||||
int err = uv_process_kill(&wrap->process_, signal);
|
||||
|
@ -83,7 +83,7 @@ class SignalWrap : public HandleWrap {
|
||||
static void Start(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
SignalWrap* wrap;
|
||||
UNWRAP(args.This(), SignalWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), SignalWrap, wrap);
|
||||
|
||||
int signum = args[0]->Int32Value();
|
||||
int err = uv_signal_start(&wrap->handle_, OnSignal, signum);
|
||||
@ -93,7 +93,7 @@ class SignalWrap : public HandleWrap {
|
||||
static void Stop(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
SignalWrap* wrap;
|
||||
UNWRAP(args.This(), SignalWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), SignalWrap, wrap);
|
||||
|
||||
int err = uv_signal_stop(&wrap->handle_);
|
||||
args.GetReturnValue().Set(err);
|
||||
|
@ -81,7 +81,7 @@ void StreamWrap::GetFD(Local<String>, const PropertyCallbackInfo<Value>& args) {
|
||||
#if !defined(_WIN32)
|
||||
HandleScope scope(node_isolate);
|
||||
StreamWrap* wrap;
|
||||
UNWRAP_NO_ABORT(args.This(), StreamWrap, wrap);
|
||||
NODE_UNWRAP_NO_ABORT(args.This(), StreamWrap, wrap);
|
||||
int fd = -1;
|
||||
if (wrap != NULL && wrap->stream() != NULL) {
|
||||
fd = wrap->stream()->io_watcher.fd;
|
||||
@ -103,7 +103,7 @@ void StreamWrap::ReadStart(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
StreamWrap* wrap;
|
||||
UNWRAP(args.This(), StreamWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), StreamWrap, wrap);
|
||||
|
||||
int err;
|
||||
if (wrap->is_named_pipe_ipc()) {
|
||||
@ -120,7 +120,7 @@ void StreamWrap::ReadStop(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
StreamWrap* wrap;
|
||||
UNWRAP(args.This(), StreamWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), StreamWrap, wrap);
|
||||
|
||||
int err = uv_read_stop(wrap->stream());
|
||||
args.GetReturnValue().Set(err);
|
||||
@ -145,7 +145,7 @@ static Local<Object> AcceptHandle(uv_stream_t* pipe) {
|
||||
return Local<Object>();
|
||||
|
||||
WrapType* wrap;
|
||||
UNWRAP(wrap_obj, WrapType, wrap);
|
||||
NODE_UNWRAP(wrap_obj, WrapType, wrap);
|
||||
handle = wrap->UVHandle();
|
||||
|
||||
if (uv_accept(pipe, reinterpret_cast<uv_stream_t*>(handle)))
|
||||
@ -205,7 +205,7 @@ void StreamWrap::WriteBuffer(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
StreamWrap* wrap;
|
||||
UNWRAP(args.This(), StreamWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), StreamWrap, wrap);
|
||||
|
||||
assert(args[0]->IsObject());
|
||||
assert(Buffer::HasInstance(args[1]));
|
||||
@ -243,7 +243,7 @@ void StreamWrap::WriteStringImpl(const FunctionCallbackInfo<Value>& args) {
|
||||
int err;
|
||||
|
||||
StreamWrap* wrap;
|
||||
UNWRAP(args.This(), StreamWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), StreamWrap, wrap);
|
||||
|
||||
assert(args[0]->IsObject());
|
||||
assert(args[1]->IsString());
|
||||
@ -293,7 +293,7 @@ void StreamWrap::WriteStringImpl(const FunctionCallbackInfo<Value>& args) {
|
||||
if (args[2]->IsObject()) {
|
||||
Local<Object> send_handle_obj = args[2].As<Object>();
|
||||
HandleWrap* wrap;
|
||||
UNWRAP(send_handle_obj, HandleWrap, wrap);
|
||||
NODE_UNWRAP(send_handle_obj, HandleWrap, wrap);
|
||||
send_handle = wrap->GetHandle();
|
||||
|
||||
// Reference StreamWrap instance to prevent it from being garbage
|
||||
@ -329,7 +329,7 @@ void StreamWrap::Writev(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope;
|
||||
|
||||
StreamWrap* wrap;
|
||||
UNWRAP(args.This(), StreamWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), StreamWrap, wrap);
|
||||
|
||||
assert(args[0]->IsObject());
|
||||
assert(args[1]->IsArray());
|
||||
@ -474,7 +474,7 @@ void StreamWrap::Shutdown(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
StreamWrap* wrap;
|
||||
UNWRAP(args.This(), StreamWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), StreamWrap, wrap);
|
||||
|
||||
assert(args[0]->IsObject());
|
||||
Local<Object> req_wrap_obj = args[0].As<Object>();
|
||||
|
@ -130,7 +130,7 @@ void TCPWrap::Initialize(Handle<Object> target) {
|
||||
|
||||
TCPWrap* TCPWrap::Unwrap(Local<Object> obj) {
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(obj, TCPWrap, wrap);
|
||||
NODE_UNWRAP(obj, TCPWrap, wrap);
|
||||
return wrap;
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ void TCPWrap::GetSockName(const FunctionCallbackInfo<Value>& args) {
|
||||
struct sockaddr_storage address;
|
||||
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(args.This(), TCPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TCPWrap, wrap);
|
||||
|
||||
assert(args[0]->IsObject());
|
||||
Local<Object> out = args[0].As<Object>();
|
||||
@ -193,7 +193,7 @@ void TCPWrap::GetPeerName(const FunctionCallbackInfo<Value>& args) {
|
||||
struct sockaddr_storage address;
|
||||
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(args.This(), TCPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TCPWrap, wrap);
|
||||
|
||||
assert(args[0]->IsObject());
|
||||
Local<Object> out = args[0].As<Object>();
|
||||
@ -215,7 +215,7 @@ void TCPWrap::SetNoDelay(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(args.This(), TCPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TCPWrap, wrap);
|
||||
|
||||
int enable = static_cast<int>(args[0]->BooleanValue());
|
||||
int err = uv_tcp_nodelay(&wrap->handle_, enable);
|
||||
@ -227,7 +227,7 @@ void TCPWrap::SetKeepAlive(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(args.This(), TCPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TCPWrap, wrap);
|
||||
|
||||
int enable = args[0]->Int32Value();
|
||||
unsigned int delay = args[1]->Uint32Value();
|
||||
@ -242,7 +242,7 @@ void TCPWrap::SetSimultaneousAccepts(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(args.This(), TCPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TCPWrap, wrap);
|
||||
|
||||
bool enable = args[0]->BooleanValue();
|
||||
int err = uv_tcp_simultaneous_accepts(&wrap->handle_, enable);
|
||||
@ -254,7 +254,7 @@ void TCPWrap::SetSimultaneousAccepts(const FunctionCallbackInfo<Value>& args) {
|
||||
void TCPWrap::Open(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(args.This(), TCPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TCPWrap, wrap);
|
||||
int fd = args[0]->IntegerValue();
|
||||
uv_tcp_open(&wrap->handle_, fd);
|
||||
}
|
||||
@ -264,7 +264,7 @@ void TCPWrap::Bind(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(args.This(), TCPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TCPWrap, wrap);
|
||||
|
||||
String::AsciiValue ip_address(args[0]);
|
||||
int port = args[1]->Int32Value();
|
||||
@ -280,7 +280,7 @@ void TCPWrap::Bind6(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(args.This(), TCPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TCPWrap, wrap);
|
||||
|
||||
String::AsciiValue ip6_address(args[0]);
|
||||
int port = args[1]->Int32Value();
|
||||
@ -296,7 +296,7 @@ void TCPWrap::Listen(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(args.This(), TCPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TCPWrap, wrap);
|
||||
|
||||
int backlog = args[0]->Int32Value();
|
||||
int err = uv_listen(reinterpret_cast<uv_stream_t*>(&wrap->handle_),
|
||||
@ -327,7 +327,7 @@ void TCPWrap::OnConnection(uv_stream_t* handle, int status) {
|
||||
|
||||
// Unwrap the client javascript object.
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(client_obj, TCPWrap, wrap);
|
||||
NODE_UNWRAP(client_obj, TCPWrap, wrap);
|
||||
uv_stream_t* client_handle = reinterpret_cast<uv_stream_t*>(&wrap->handle_);
|
||||
if (uv_accept(handle, client_handle))
|
||||
return;
|
||||
@ -368,7 +368,7 @@ void TCPWrap::Connect(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(args.This(), TCPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TCPWrap, wrap);
|
||||
|
||||
assert(args[0]->IsObject());
|
||||
assert(args[1]->IsString());
|
||||
@ -400,7 +400,7 @@ void TCPWrap::Connect6(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TCPWrap* wrap;
|
||||
UNWRAP(args.This(), TCPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TCPWrap, wrap);
|
||||
|
||||
assert(args[0]->IsObject());
|
||||
assert(args[1]->IsString());
|
||||
|
@ -86,7 +86,7 @@ class TimerWrap : public HandleWrap {
|
||||
static void Start(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
TimerWrap* wrap;
|
||||
UNWRAP(args.This(), TimerWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TimerWrap, wrap);
|
||||
|
||||
int64_t timeout = args[0]->IntegerValue();
|
||||
int64_t repeat = args[1]->IntegerValue();
|
||||
@ -97,7 +97,7 @@ class TimerWrap : public HandleWrap {
|
||||
static void Stop(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
TimerWrap* wrap;
|
||||
UNWRAP(args.This(), TimerWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TimerWrap, wrap);
|
||||
|
||||
int err = uv_timer_stop(&wrap->handle_);
|
||||
args.GetReturnValue().Set(err);
|
||||
@ -106,7 +106,7 @@ class TimerWrap : public HandleWrap {
|
||||
static void Again(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
TimerWrap* wrap;
|
||||
UNWRAP(args.This(), TimerWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TimerWrap, wrap);
|
||||
|
||||
int err = uv_timer_again(&wrap->handle_);
|
||||
args.GetReturnValue().Set(err);
|
||||
@ -115,7 +115,7 @@ class TimerWrap : public HandleWrap {
|
||||
static void SetRepeat(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
TimerWrap* wrap;
|
||||
UNWRAP(args.This(), TimerWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TimerWrap, wrap);
|
||||
|
||||
int64_t repeat = args[0]->IntegerValue();
|
||||
uv_timer_set_repeat(&wrap->handle_, repeat);
|
||||
@ -125,7 +125,7 @@ class TimerWrap : public HandleWrap {
|
||||
static void GetRepeat(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
TimerWrap* wrap;
|
||||
UNWRAP(args.This(), TimerWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TimerWrap, wrap);
|
||||
|
||||
int64_t repeat = uv_timer_get_repeat(&wrap->handle_);
|
||||
args.GetReturnValue().Set(static_cast<double>(repeat));
|
||||
|
@ -100,7 +100,7 @@ TLSCallbacks::TLSCallbacks(Kind kind,
|
||||
sc_handle_.Reset(node_isolate, sc);
|
||||
|
||||
Local<Object> object = NewInstance(tlsWrap);
|
||||
WRAP(object, this);
|
||||
NODE_WRAP(object, this);
|
||||
persistent().Reset(node_isolate, object);
|
||||
|
||||
// Initialize queue for clearIn writes
|
||||
@ -333,7 +333,7 @@ void TLSCallbacks::Start(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
if (wrap->started_)
|
||||
return ThrowError("Already started.");
|
||||
@ -669,7 +669,7 @@ void TLSCallbacks::VerifyError(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
// XXX Do this check in JS land?
|
||||
X509* peer_cert = SSL_get_peer_certificate(wrap->ssl_);
|
||||
@ -736,7 +736,7 @@ void TLSCallbacks::SetVerifyMode(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
if (args.Length() < 2 || !args[0]->IsBoolean() || !args[1]->IsBoolean())
|
||||
return ThrowTypeError("Bad arguments, expected two booleans");
|
||||
@ -765,7 +765,7 @@ void TLSCallbacks::SetVerifyMode(const FunctionCallbackInfo<Value>& args) {
|
||||
void TLSCallbacks::IsSessionReused(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
bool yes = SSL_session_reused(wrap->ssl_);
|
||||
args.GetReturnValue().Set(yes);
|
||||
}
|
||||
@ -776,7 +776,7 @@ void TLSCallbacks::EnableSessionCallbacks(
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
wrap->session_callbacks_ = true;
|
||||
EnableHelloParser(args);
|
||||
@ -787,7 +787,7 @@ void TLSCallbacks::EnableHelloParser(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
wrap->hello_.Start(OnClientHello, OnClientHelloParseEnd, wrap);
|
||||
}
|
||||
@ -829,7 +829,7 @@ void TLSCallbacks::GetPeerCertificate(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
Local<Object> info = Object::New();
|
||||
X509* peer_cert = SSL_get_peer_certificate(wrap->ssl_);
|
||||
@ -962,7 +962,7 @@ void TLSCallbacks::GetSession(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
SSL_SESSION* sess = SSL_get_session(wrap->ssl_);
|
||||
if (!sess) return;
|
||||
@ -988,7 +988,7 @@ void TLSCallbacks::SetSession(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
if (wrap->started_)
|
||||
return ThrowError("Already started.");
|
||||
@ -1024,7 +1024,7 @@ void TLSCallbacks::LoadSession(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
if (args.Length() >= 1 && Buffer::HasInstance(args[0])) {
|
||||
ssize_t slen = Buffer::Length(args[0]);
|
||||
@ -1055,7 +1055,7 @@ void TLSCallbacks::EndParser(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
wrap->hello_.End();
|
||||
}
|
||||
@ -1065,7 +1065,7 @@ void TLSCallbacks::GetCurrentCipher(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
const SSL_CIPHER* c;
|
||||
|
||||
@ -1159,7 +1159,7 @@ void TLSCallbacks::GetNegotiatedProto(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
if (wrap->kind_ == kTLSClient) {
|
||||
if (wrap->selected_npn_proto_.IsEmpty() == false) {
|
||||
@ -1186,7 +1186,7 @@ void TLSCallbacks::SetNPNProtocols(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
if (args.Length() < 1 || !Buffer::HasInstance(args[0]))
|
||||
return ThrowTypeError("Must give a Buffer as first argument");
|
||||
@ -1201,7 +1201,7 @@ void TLSCallbacks::GetServername(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
const char* servername = SSL_get_servername(wrap->ssl_,
|
||||
TLSEXT_NAMETYPE_host_name);
|
||||
@ -1217,7 +1217,7 @@ void TLSCallbacks::SetServername(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TLSCallbacks* wrap;
|
||||
UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
NODE_UNWRAP(args.This(), TLSCallbacks, wrap);
|
||||
|
||||
if (args.Length() < 1 || !args[0]->IsString())
|
||||
return ThrowTypeError("First argument should be a string");
|
||||
|
@ -88,7 +88,7 @@ void TTYWrap::Initialize(Handle<Object> target) {
|
||||
|
||||
TTYWrap* TTYWrap::Unwrap(Local<Object> obj) {
|
||||
TTYWrap* wrap;
|
||||
UNWRAP(obj, TTYWrap, wrap);
|
||||
NODE_UNWRAP(obj, TTYWrap, wrap);
|
||||
return wrap;
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ void TTYWrap::GetWindowSize(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TTYWrap* wrap;
|
||||
UNWRAP(args.This(), TTYWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TTYWrap, wrap);
|
||||
assert(args[0]->IsArray());
|
||||
|
||||
int width, height;
|
||||
@ -154,7 +154,7 @@ void TTYWrap::SetRawMode(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
TTYWrap* wrap;
|
||||
UNWRAP(args.This(), TTYWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), TTYWrap, wrap);
|
||||
|
||||
int err = uv_tty_set_mode(&wrap->handle_, args[0]->IsTrue());
|
||||
args.GetReturnValue().Set(err);
|
||||
|
@ -136,7 +136,7 @@ void UDPWrap::GetFD(Local<String>, const PropertyCallbackInfo<Value>& args) {
|
||||
#if !defined(_WIN32)
|
||||
HandleScope scope(node_isolate);
|
||||
UDPWrap* wrap;
|
||||
UNWRAP(args.This(), UDPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), UDPWrap, wrap);
|
||||
int fd = (wrap == NULL) ? -1 : wrap->handle_.io_watcher.fd;
|
||||
args.GetReturnValue().Set(fd);
|
||||
#endif
|
||||
@ -148,7 +148,7 @@ void UDPWrap::DoBind(const FunctionCallbackInfo<Value>& args, int family) {
|
||||
int err;
|
||||
|
||||
UDPWrap* wrap;
|
||||
UNWRAP(args.This(), UDPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), UDPWrap, wrap);
|
||||
|
||||
// bind(ip, port, flags)
|
||||
assert(args.Length() == 3);
|
||||
@ -187,7 +187,7 @@ void UDPWrap::Bind6(const FunctionCallbackInfo<Value>& args) {
|
||||
void UDPWrap::name(const FunctionCallbackInfo<Value>& args) { \
|
||||
HandleScope scope(node_isolate); \
|
||||
UDPWrap* wrap; \
|
||||
UNWRAP(args.This(), UDPWrap, wrap); \
|
||||
NODE_UNWRAP(args.This(), UDPWrap, wrap); \
|
||||
assert(args.Length() == 1); \
|
||||
int flag = args[0]->Int32Value(); \
|
||||
int err = fn(&wrap->handle_, flag); \
|
||||
@ -206,7 +206,7 @@ void UDPWrap::SetMembership(const FunctionCallbackInfo<Value>& args,
|
||||
uv_membership membership) {
|
||||
HandleScope scope(node_isolate);
|
||||
UDPWrap* wrap;
|
||||
UNWRAP(args.This(), UDPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), UDPWrap, wrap);
|
||||
|
||||
assert(args.Length() == 2);
|
||||
|
||||
@ -241,7 +241,7 @@ void UDPWrap::DoSend(const FunctionCallbackInfo<Value>& args, int family) {
|
||||
int err;
|
||||
|
||||
UDPWrap* wrap;
|
||||
UNWRAP(args.This(), UDPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), UDPWrap, wrap);
|
||||
|
||||
// send(req, buffer, offset, length, port, address)
|
||||
assert(args[0]->IsObject());
|
||||
@ -310,7 +310,7 @@ void UDPWrap::Send6(const FunctionCallbackInfo<Value>& args) {
|
||||
void UDPWrap::RecvStart(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
UDPWrap* wrap;
|
||||
UNWRAP(args.This(), UDPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), UDPWrap, wrap);
|
||||
|
||||
int err = uv_udp_recv_start(&wrap->handle_, OnAlloc, OnRecv);
|
||||
// UV_EALREADY means that the socket is already bound but that's okay
|
||||
@ -322,7 +322,7 @@ void UDPWrap::RecvStart(const FunctionCallbackInfo<Value>& args) {
|
||||
void UDPWrap::RecvStop(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
UDPWrap* wrap;
|
||||
UNWRAP(args.This(), UDPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), UDPWrap, wrap);
|
||||
|
||||
int r = uv_udp_recv_stop(&wrap->handle_);
|
||||
args.GetReturnValue().Set(r);
|
||||
@ -333,7 +333,7 @@ void UDPWrap::GetSockName(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
struct sockaddr_storage address;
|
||||
UDPWrap* wrap;
|
||||
UNWRAP(args.This(), UDPWrap, wrap);
|
||||
NODE_UNWRAP(args.This(), UDPWrap, wrap);
|
||||
|
||||
assert(args[0]->IsObject());
|
||||
Local<Object> obj = args[0].As<Object>();
|
||||
@ -414,7 +414,7 @@ void UDPWrap::OnRecv(uv_udp_t* handle,
|
||||
|
||||
UDPWrap* UDPWrap::Unwrap(Local<Object> obj) {
|
||||
UDPWrap* wrap;
|
||||
UNWRAP(obj, UDPWrap, wrap);
|
||||
NODE_UNWRAP(obj, UDPWrap, wrap);
|
||||
return wrap;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user