Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
buffer: fix gcc 4.2 build breakage
Browse files Browse the repository at this point in the history
gcc 4.2 on OS X gets confused about the call to node::Buffer::Data().
Fully qualify the function name to help it along.

Fixes the following build error:

    ../../deps/v8/include/v8.h: In function ‘char*
    node::Buffer::Data(v8::Handle<v8::Value>)’:
    ../../deps/v8/include/v8.h:900: error: ‘class v8::Data’
    is not a function,
    ../../src/node_buffer.h:38: error:
    conflict with ‘char* node::Buffer::Data(v8::Handle<v8::Object>)’
    ../../src/node_buffer.cc:94: error:
    in call to ‘Data’
  • Loading branch information
bnoordhuis committed Jun 20, 2013
1 parent 24ba9fd commit 157d2bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ bool HasInstance(Handle<Object> obj) {

char* Data(Handle<Value> val) {
assert(val->IsObject());
return Data(val.As<Object>());
// Use a fully qualified name here to work around a bug in gcc 4.2.
// It mistakes an unadorned call to Data() for the v8::String::Data type.
return node::Buffer::Data(val.As<Object>());
}


Expand Down

0 comments on commit 157d2bc

Please sign in to comment.