我从 NodeJS 核心(加密)中获取了一段简单的代码:
ASSERT_IS_BUFFER(args[0]);
ssize_t klen = Buffer::Length(args[0]);
但是,node-gyp
在我自己的本机扩展中编译它时,我收到以下错误:
../deps/v8/include/v8.h:202:5: error: assigning to 'v8::Object *volatile' from incompatible type
'v8::Value *'
TYPE_CHECK(T, S);
^
../deps/v8/include/v8.h:145:37: note: expanded from macro 'TYPE_CHECK'
*(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \
^
../src/openssljs.cc:300:33: note: in instantiation of function template specialization 'v8::Handle<v8::Object>::Handle<v8::Value>'
requested here
ssize_t klen = Buffer::Length(args[0]);
^
知道是什么原因造成的吗?