From 157d2bcc04fc1fb47033db7cae00c7d593c1bf0c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 20 Jun 2013 13:21:05 +0200 Subject: [PATCH] buffer: fix gcc 4.2 build breakage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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)’: ../../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)’ ../../src/node_buffer.cc:94: error: in call to ‘Data’ --- src/node_buffer.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node_buffer.cc b/src/node_buffer.cc index d304063abc7..f9317c479dd 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -91,7 +91,9 @@ bool HasInstance(Handle obj) { char* Data(Handle val) { assert(val->IsObject()); - return Data(val.As()); + // 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()); }