From bd04c60094e4f1132a05cbb49039f5732a533591 Mon Sep 17 00:00:00 2001 From: Tyler Wanek Date: Fri, 18 Jan 2019 17:38:14 -0700 Subject: [PATCH 1/2] Get rid of deprecated function calls --- src/NSFW.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/NSFW.cpp b/src/NSFW.cpp index 13eb8a65..9cd1ab16 100644 --- a/src/NSFW.cpp +++ b/src/NSFW.cpp @@ -48,7 +48,7 @@ void NSFW::fireErrorCallback(uv_async_t *handle) { v8::Local argv[] = { New(baton->error).ToLocalChecked() }; - baton->nsfw->mErrorCallback->Call(1, argv); + baton->nsfw->mErrorCallback->Call(1, argv, nullptr); delete baton; } @@ -90,7 +90,7 @@ void NSFW::fireEventCallback(uv_async_t *handle) { eventArray }; - baton->nsfw->mEventCallback->Call(1, argv); + baton->nsfw->mEventCallback->Call(1, argv, nullptr); uv_thread_t cleanup; uv_thread_create(&cleanup, NSFW::cleanupEventCallback, baton); @@ -206,7 +206,7 @@ NAN_METHOD(NSFW::Start) { v8::Local argv[1] = { Nan::Error("This NSFW cannot be started, because it is already running.") }; - callback->Call(1, argv); + callback->Call(1, argv, nullptr); delete callback; return; } @@ -252,9 +252,9 @@ void NSFW::StartWorker::HandleOKCallback() { v8::Local argv[1] = { Nan::Error("NSFW was unable to start watching that directory.") }; - callback->Call(1, argv); + callback->Call(1, argv, nullptr); } else { - callback->Call(0, NULL); + callback->Call(0, nullptr, nullptr); } } @@ -279,7 +279,7 @@ NAN_METHOD(NSFW::Stop) { v8::Local argv[1] = { Nan::Error("This NSFW cannot be stopped, because it is not running.") }; - callback->Call(1, argv); + callback->Call(1, argv, nullptr); delete callback; return; } @@ -321,7 +321,7 @@ void NSFW::StopWorker::HandleOKCallback() { uv_close(reinterpret_cast(&mNSFW->mErrorCallbackAsync), nullptr); uv_close(reinterpret_cast(&mNSFW->mEventCallbackAsync), nullptr); - callback->Call(0, NULL); + callback->Call(0, nullptr, nullptr); } NODE_MODULE(nsfw, NSFW::Init) From bf997253e4e5d9a45afe75bc0e3e66acad09c782 Mon Sep 17 00:00:00 2001 From: Tyler Wanek Date: Fri, 18 Jan 2019 17:44:42 -0700 Subject: [PATCH 2/2] Change some macro directives to be more well defined --- includes/NativeInterface.h | 2 +- src/NSFW.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/NativeInterface.h b/includes/NativeInterface.h index e2322d7c..68bf789b 100644 --- a/includes/NativeInterface.h +++ b/includes/NativeInterface.h @@ -4,7 +4,7 @@ #if defined(_WIN32) #include "../includes/win32/Controller.h" using NativeImplementation = Controller; -#elif defined(__APPLE_CC__) +#elif defined(__APPLE__) #include "../includes/osx/FSEventsService.h" using NativeImplementation = FSEventsService; #elif defined(__linux__) || defined(__FreeBSD__) diff --git a/src/NSFW.cpp b/src/NSFW.cpp index 9cd1ab16..724a4773 100644 --- a/src/NSFW.cpp +++ b/src/NSFW.cpp @@ -59,7 +59,7 @@ void NSFW::fireEventCallback(uv_async_t *handle) { uv_thread_t cleanup; uv_thread_create(&cleanup, NSFW::cleanupEventCallback, baton); - #if defined(__APPLE_CC__) || defined(__linux__) || defined(__FreeBSD__) + #if defined(__unix__) pthread_detach(cleanup); #endif @@ -95,7 +95,7 @@ void NSFW::fireEventCallback(uv_async_t *handle) { uv_thread_t cleanup; uv_thread_create(&cleanup, NSFW::cleanupEventCallback, baton); - #if defined(__APPLE_CC__) || defined(__linux__) || defined(__FreeBSD__) + #if defined(__unix__) pthread_detach(cleanup); #endif }