diff --git a/README.md b/README.md index 17e0433f9..41eaa9a5d 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,11 @@ To use N-API in a native module: ```gyp 'cflags!': [ '-fno-exceptions' ], 'cflags_cc!': [ '-fno-exceptions' ], - 'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES' }, + 'xcode_settings': { + 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', + 'CLANG_CXX_LIBRARY': 'libc++', + 'MACOSX_DEPLOYMENT_TARGET': '10.7', + }, 'msvs_settings': { 'VCCLCompilerTool': { 'ExceptionHandling': 1 }, }, diff --git a/napi-inl.h b/napi-inl.h index 0547a910e..88d058945 100644 --- a/napi-inl.h +++ b/napi-inl.h @@ -1965,7 +1965,7 @@ PropertyDescriptor::Accessor(const char* utf8name, void* data) { typedef details::CallbackData CbData; // TODO: Delete when the function is destroyed - auto callbackData = new CbData({ getter }); + auto callbackData = new CbData({ getter, nullptr }); return PropertyDescriptor({ utf8name, @@ -1994,7 +1994,7 @@ inline PropertyDescriptor PropertyDescriptor::Accessor(napi_value name, void* data) { typedef details::CallbackData CbData; // TODO: Delete when the function is destroyed - auto callbackData = new CbData({ getter }); + auto callbackData = new CbData({ getter, nullptr }); return PropertyDescriptor({ nullptr, @@ -2088,7 +2088,7 @@ inline PropertyDescriptor PropertyDescriptor::Function(const char* utf8name, typedef decltype(cb(CallbackInfo(nullptr, nullptr))) ReturnType; typedef details::CallbackData CbData; // TODO: Delete when the function is destroyed - auto callbackData = new CbData({ cb }); + auto callbackData = new CbData({ cb, nullptr }); return PropertyDescriptor({ utf8name, @@ -2118,7 +2118,7 @@ inline PropertyDescriptor PropertyDescriptor::Function(napi_value name, typedef decltype(cb(CallbackInfo(nullptr, nullptr))) ReturnType; typedef details::CallbackData CbData; // TODO: Delete when the function is destroyed - auto callbackData = new CbData({ cb }); + auto callbackData = new CbData({ cb, nullptr }); return PropertyDescriptor({ nullptr, diff --git a/test/arraybuffer.cc b/test/arraybuffer.cc index 66d5da8d8..74df7f8b3 100644 --- a/test/arraybuffer.cc +++ b/test/arraybuffer.cc @@ -57,7 +57,7 @@ Value CreateExternalBufferWithFinalize(const CallbackInfo& info) { data, testLength, [](Env env, void* finalizeData) { - delete[] finalizeData; + delete[] static_cast(finalizeData); finalizeCount++; }); @@ -82,7 +82,7 @@ Value CreateExternalBufferWithFinalizeHint(const CallbackInfo& info) { data, testLength, [](Env env, void* finalizeData, char* finalizeHint) { - delete[] finalizeData; + delete[] static_cast(finalizeData); finalizeCount++; }, hint); diff --git a/test/binding.gyp b/test/binding.gyp index 38e9443a6..35f6de1f1 100644 --- a/test/binding.gyp +++ b/test/binding.gyp @@ -17,7 +17,11 @@ 'dependencies': ["