From 35f789b02795ed8dd177b65f80b53f408dc7fe09 Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Mon, 12 Aug 2013 12:54:49 -0700 Subject: [PATCH] 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_. --- src/fs_event_wrap.cc | 4 ++-- src/handle_wrap.cc | 8 ++++---- src/node_crypto.cc | 4 ++-- src/node_internals.h | 6 +++--- src/pipe_wrap.cc | 14 +++++++------- src/process_wrap.cc | 4 ++-- src/signal_wrap.cc | 4 ++-- src/stream_wrap.cc | 18 +++++++++--------- src/tcp_wrap.cc | 26 +++++++++++++------------- src/timer_wrap.cc | 10 +++++----- src/tls_wrap.cc | 34 +++++++++++++++++----------------- src/tty_wrap.cc | 6 +++--- src/udp_wrap.cc | 18 +++++++++--------- 13 files changed, 78 insertions(+), 78 deletions(-) diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index 9efaa99..8906f43 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -99,7 +99,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo& 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& 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; diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index 749be4b..4aba0ef 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -42,7 +42,7 @@ void HandleWrap::Ref(const FunctionCallbackInfo& 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& 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& 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, 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_); } diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 5a9646d..9110eab 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -760,7 +760,7 @@ void SecureContext::GetTicketKeys(const FunctionCallbackInfo& args) { HandleScope scope(node_isolate); SecureContext* wrap; - UNWRAP(args.This(), SecureContext, wrap); + NODE_UNWRAP(args.This(), SecureContext, wrap); Local buff = Buffer::New(48); if (SSL_CTX_get_tlsext_ticket_keys(wrap->ctx_, @@ -785,7 +785,7 @@ void SecureContext::SetTicketKeys(const FunctionCallbackInfo& 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]), diff --git a/src/node_internals.h b/src/node_internals.h index 3fe0d67..5e7e65c 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -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); \ diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index 8c28357..8884fec 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -67,7 +67,7 @@ Local PipeWrap::Instantiate() { PipeWrap* PipeWrap::Unwrap(Local obj) { PipeWrap* wrap; - UNWRAP(obj, PipeWrap, wrap); + NODE_UNWRAP(obj, PipeWrap, wrap); return wrap; } @@ -146,7 +146,7 @@ void PipeWrap::Bind(const FunctionCallbackInfo& 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& 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& 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(&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(&wrap->handle_); if (uv_accept(handle, client_handle)) return; @@ -263,7 +263,7 @@ void PipeWrap::Open(const FunctionCallbackInfo& 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& 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()); diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 48f7ae2..77299ea 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -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 js_options = args[0]->ToObject(); @@ -258,7 +258,7 @@ class ProcessWrap : public HandleWrap { static void Kill(const FunctionCallbackInfo& 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); diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index 4735692..b9f6d49 100644 --- a/src/signal_wrap.cc +++ b/src/signal_wrap.cc @@ -83,7 +83,7 @@ class SignalWrap : public HandleWrap { static void Start(const FunctionCallbackInfo& 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& 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); diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 42d4eb4..e2c6843 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -81,7 +81,7 @@ void StreamWrap::GetFD(Local, const PropertyCallbackInfo& 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& 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& 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 AcceptHandle(uv_stream_t* pipe) { return Local(); WrapType* wrap; - UNWRAP(wrap_obj, WrapType, wrap); + NODE_UNWRAP(wrap_obj, WrapType, wrap); handle = wrap->UVHandle(); if (uv_accept(pipe, reinterpret_cast(handle))) @@ -205,7 +205,7 @@ void StreamWrap::WriteBuffer(const FunctionCallbackInfo& 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& 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& args) { if (args[2]->IsObject()) { Local send_handle_obj = args[2].As(); 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& 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& args) { HandleScope scope(node_isolate); StreamWrap* wrap; - UNWRAP(args.This(), StreamWrap, wrap); + NODE_UNWRAP(args.This(), StreamWrap, wrap); assert(args[0]->IsObject()); Local req_wrap_obj = args[0].As(); diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index a8b3be2..d24fb50 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -130,7 +130,7 @@ void TCPWrap::Initialize(Handle target) { TCPWrap* TCPWrap::Unwrap(Local obj) { TCPWrap* wrap; - UNWRAP(obj, TCPWrap, wrap); + NODE_UNWRAP(obj, TCPWrap, wrap); return wrap; } @@ -170,7 +170,7 @@ void TCPWrap::GetSockName(const FunctionCallbackInfo& args) { struct sockaddr_storage address; TCPWrap* wrap; - UNWRAP(args.This(), TCPWrap, wrap); + NODE_UNWRAP(args.This(), TCPWrap, wrap); assert(args[0]->IsObject()); Local out = args[0].As(); @@ -193,7 +193,7 @@ void TCPWrap::GetPeerName(const FunctionCallbackInfo& args) { struct sockaddr_storage address; TCPWrap* wrap; - UNWRAP(args.This(), TCPWrap, wrap); + NODE_UNWRAP(args.This(), TCPWrap, wrap); assert(args[0]->IsObject()); Local out = args[0].As(); @@ -215,7 +215,7 @@ void TCPWrap::SetNoDelay(const FunctionCallbackInfo& args) { HandleScope scope(node_isolate); TCPWrap* wrap; - UNWRAP(args.This(), TCPWrap, wrap); + NODE_UNWRAP(args.This(), TCPWrap, wrap); int enable = static_cast(args[0]->BooleanValue()); int err = uv_tcp_nodelay(&wrap->handle_, enable); @@ -227,7 +227,7 @@ void TCPWrap::SetKeepAlive(const FunctionCallbackInfo& 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& 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& args) { void TCPWrap::Open(const FunctionCallbackInfo& 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& 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& 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& 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(&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(&wrap->handle_); if (uv_accept(handle, client_handle)) return; @@ -368,7 +368,7 @@ void TCPWrap::Connect(const FunctionCallbackInfo& 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& 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()); diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index ba710a1..8abe33e 100644 --- a/src/timer_wrap.cc +++ b/src/timer_wrap.cc @@ -86,7 +86,7 @@ class TimerWrap : public HandleWrap { static void Start(const FunctionCallbackInfo& 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& 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& 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& 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& 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(repeat)); diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index c4fc5a6..65a5d31 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -100,7 +100,7 @@ TLSCallbacks::TLSCallbacks(Kind kind, sc_handle_.Reset(node_isolate, sc); Local 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& 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& 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& 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& args) { void TLSCallbacks::IsSessionReused(const FunctionCallbackInfo& 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& 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& args) { HandleScope scope(node_isolate); TLSCallbacks* wrap; - UNWRAP(args.This(), TLSCallbacks, wrap); + NODE_UNWRAP(args.This(), TLSCallbacks, wrap); Local info = Object::New(); X509* peer_cert = SSL_get_peer_certificate(wrap->ssl_); @@ -962,7 +962,7 @@ void TLSCallbacks::GetSession(const FunctionCallbackInfo& 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& 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& 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& 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& 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& 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& 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& 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& 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"); diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index e5c6080..0b675e1 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -88,7 +88,7 @@ void TTYWrap::Initialize(Handle target) { TTYWrap* TTYWrap::Unwrap(Local obj) { TTYWrap* wrap; - UNWRAP(obj, TTYWrap, wrap); + NODE_UNWRAP(obj, TTYWrap, wrap); return wrap; } @@ -134,7 +134,7 @@ void TTYWrap::GetWindowSize(const FunctionCallbackInfo& 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& 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); diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index b06c743..d72727a 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -136,7 +136,7 @@ void UDPWrap::GetFD(Local, const PropertyCallbackInfo& 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& 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& args) { void UDPWrap::name(const FunctionCallbackInfo& 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& 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& 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& args) { void UDPWrap::RecvStart(const FunctionCallbackInfo& 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& args) { void UDPWrap::RecvStop(const FunctionCallbackInfo& 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& 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 obj = args[0].As(); @@ -414,7 +414,7 @@ void UDPWrap::OnRecv(uv_udp_t* handle, UDPWrap* UDPWrap::Unwrap(Local obj) { UDPWrap* wrap; - UNWRAP(obj, UDPWrap, wrap); + NODE_UNWRAP(obj, UDPWrap, wrap); return wrap; } -- 2.7.4