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

chore: add support for building with v8 7.6 #322

Merged
merged 3 commits into from
Jun 7, 2019
Merged
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
21 changes: 3 additions & 18 deletions src/unix/pty.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,7 @@
#if defined(__GLIBC__) || defined(__CYGWIN__)
#include <pty.h>
#elif defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__)
/**
* From node v0.10.28 (at least?) there is also a "util.h" in node/src, which
* would confuse the compiler when looking for "util.h".
*/
#if NODE_VERSION_AT_LEAST(0, 10, 28)
#include <../include/util.h>
#else
#include <util.h>
#endif
#elif defined(__FreeBSD__)
#include <libutil.h>
#elif defined(__sun)
Expand Down Expand Up @@ -120,11 +112,7 @@ static void
pty_waitpid(void *);

static void
#if NODE_VERSION_AT_LEAST(0, 11, 0)
pty_after_waitpid(uv_async_t *);
#else
pty_after_waitpid(uv_async_t *, int);
#endif

static void
pty_after_close(uv_handle_t *);
Expand Down Expand Up @@ -192,7 +180,7 @@ NAN_METHOD(PtyFork) {
struct termios t = termios();
struct termios *term = &t;
term->c_iflag = ICRNL | IXON | IXANY | IMAXBEL | BRKINT;
if (info[8]->BooleanValue(Nan::GetCurrentContext()).FromJust()) {
if (Nan::To<bool>(info[8]).FromJust()) {
#if defined(IUTF8)
term->c_iflag |= IUTF8;
#endif
Expand Down Expand Up @@ -476,11 +464,7 @@ pty_waitpid(void *data) {
*/

static void
#if NODE_VERSION_AT_LEAST(0, 11, 0)
pty_after_waitpid(uv_async_t *async) {
#else
pty_after_waitpid(uv_async_t *async, int unhelpful) {
#endif
Nan::HandleScope scope;
pty_baton *baton = static_cast<pty_baton*>(async->data);

Expand All @@ -492,7 +476,8 @@ pty_after_waitpid(uv_async_t *async, int unhelpful) {
v8::Local<v8::Function> cb = Nan::New<v8::Function>(baton->cb);
baton->cb.Reset();
memset(&baton->cb, -1, sizeof(baton->cb));
Nan::Callback(cb).Call(Nan::GetCurrentContext()->Global(), 2, argv);
Nan::AsyncResource resource("pty_after_waitpid");
resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), cb, 2, argv);

uv_close((uv_handle_t *)async, pty_after_close);
}
Expand Down