pierrec / node-lz4

LZ4 fast compression algorithm for NodeJS
MIT License
438 stars 98 forks source link

Doesn't compile with node 0.12 #25

Closed benweet closed 9 years ago

benweet commented 9 years ago

Here is the output I have when trying to install with node 0.12 on OSX (works fine with 0.10):

  CXX(target) Release/obj.target/lz4/lib/binding/lz4.o
../lib/binding/lz4.cc:19:33: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle<Value> LZ4Compress(const Arguments& args) {
                                ^~~~~~~~~
                                v8::internal::Arguments
/Users/benweet/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../lib/binding/lz4.cc:20:15: error: calling a protected constructor of class 'v8::HandleScope'
  HandleScope scope;
              ^
/Users/benweet/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: note: declared protected here
  V8_INLINE HandleScope() {}
            ^
../lib/binding/lz4.cc:22:23: error: member access into incomplete type 'const v8::internal::Arguments'
  uint32_t alen = args.Length();
                      ^
/Users/benweet/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../lib/binding/lz4.cc:24:45: error: no member named 'New' in 'v8::String'
    ThrowException(Exception::Error(String::New("Wrong number of arguments")));
                                    ~~~~~~~~^
../lib/binding/lz4.cc:25:18: error: no member named 'Close' in 'v8::HandleScope'
    return scope.Close(Undefined());
           ~~~~~ ^
../lib/binding/lz4.cc:25:24: error: no matching function for call to 'Undefined'
    return scope.Close(Undefined());
                       ^~~~~~~~~
/Users/benweet/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: candidate function not viable: requires single argument 'isolate', but no
      arguments were provided
  friend Handle<Primitive> Undefined(Isolate* isolate);
                           ^
../lib/binding/lz4.cc:28:32: error: type 'const v8::internal::Arguments' does not provide a subscript operator
  if (!Buffer::HasInstance(args[0]) || !Buffer::HasInstance(args[1])) {
                           ~~~~^~
../lib/binding/lz4.cc:28:65: error: type 'const v8::internal::Arguments' does not provide a subscript operator
  if (!Buffer::HasInstance(args[0]) || !Buffer::HasInstance(args[1])) {
                                                            ~~~~^~
../lib/binding/lz4.cc:29:49: error: no member named 'New' in 'v8::String'
    ThrowException(Exception::TypeError(String::New("Wrong arguments")));
                                        ~~~~~~~~^
../lib/binding/lz4.cc:30:18: error: no member named 'Close' in 'v8::HandleScope'
    return scope.Close(Undefined());
           ~~~~~ ^
../lib/binding/lz4.cc:30:24: error: no matching function for call to 'Undefined'
    return scope.Close(Undefined());
                       ^~~~~~~~~
/Users/benweet/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: candidate function not viable: requires single argument 'isolate', but no
      arguments were provided
  friend Handle<Primitive> Undefined(Isolate* isolate);
                           ^
../lib/binding/lz4.cc:32:29: error: type 'const v8::internal::Arguments' does not provide a subscript operator
  Local<Object> input = args[0]->ToObject();
                        ~~~~^~
../lib/binding/lz4.cc:33:30: error: type 'const v8::internal::Arguments' does not provide a subscript operator
  Local<Object> output = args[1]->ToObject();
                         ~~~~^~
../lib/binding/lz4.cc:40:14: error: type 'const v8::internal::Arguments' does not provide a subscript operator
    if (!args[3]->IsUint32()) {
         ~~~~^~
../lib/binding/lz4.cc:41:51: error: no member named 'New' in 'v8::String'
      ThrowException(Exception::TypeError(String::New("Invalid endIdx")));
                                          ~~~~~~~~^
../lib/binding/lz4.cc:42:20: error: no member named 'Close' in 'v8::HandleScope'
      return scope.Close(Undefined());
             ~~~~~ ^
../lib/binding/lz4.cc:42:26: error: no matching function for call to 'Undefined'
      return scope.Close(Undefined());
                         ^~~~~~~~~
/Users/benweet/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: candidate function not viable: requires single argument 'isolate', but no
      arguments were provided
  friend Handle<Primitive> Undefined(Isolate* isolate);
                           ^
../lib/binding/lz4.cc:44:14: error: type 'const v8::internal::Arguments' does not provide a subscript operator
    if (!args[2]->IsUint32()) {
         ~~~~^~
../lib/binding/lz4.cc:45:51: error: no member named 'New' in 'v8::String'
      ThrowException(Exception::TypeError(String::New("Invalid startIdx")));
                                          ~~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
meash-nrel commented 9 years ago

same here.

anirudhaku commented 9 years ago

same here

zacharynevin commented 9 years ago

Same

pierrec commented 9 years ago

EricMCornelius has submitted a pull that fixes this issue.

The package is now at version 0.4.0 and supports node 0.12 from then on.