Browse Source

build: do not define ZLIB_CONST

This define is not available in zlib prior to version 1.2.5.2. See
https://github.com/nodejs/node/issues/9110 for details. Workaround the
build breakage reported by casting away const in src/inspector_agent.cc
instead.

PR-URL: https://github.com/nodejs/node/pull/9122
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
v6
Bradley T. Hughes 8 years ago
committed by Rod Vagg
parent
commit
a9f4fc905a
  1. 4
      deps/zlib/zlib.gyp
  2. 2
      node.gyp
  3. 2
      src/inspector_agent.cc

4
deps/zlib/zlib.gyp

@ -12,7 +12,6 @@
{
'target_name': 'zlib',
'type': 'static_library',
'defines': [ 'ZLIB_CONST' ],
'sources': [
'adler32.c',
'compress.c',
@ -45,7 +44,6 @@
'.',
],
'direct_dependent_settings': {
'defines': [ 'ZLIB_CONST' ],
'include_dirs': [
'.',
],
@ -74,12 +72,10 @@
'direct_dependent_settings': {
'defines': [
'USE_SYSTEM_ZLIB',
'ZLIB_CONST',
],
},
'defines': [
'USE_SYSTEM_ZLIB',
'ZLIB_CONST',
],
'link_settings': {
'libraries': [

2
node.gyp

@ -480,8 +480,6 @@
}],
[ 'node_shared_zlib=="false"', {
'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
}, {
'defines': [ 'ZLIB_CONST' ],
}],
[ 'node_shared_http_parser=="false"', {

2
src/inspector_agent.cc

@ -176,7 +176,7 @@ void SendProtocolJson(InspectorSocket* socket) {
PROTOCOL_JSON[0] * 0x10000u +
PROTOCOL_JSON[1] * 0x100u +
PROTOCOL_JSON[2];
strm.next_in = PROTOCOL_JSON + 3;
strm.next_in = const_cast<uint8_t*>(PROTOCOL_JSON + 3);
strm.avail_in = sizeof(PROTOCOL_JSON) - 3;
std::vector<char> data(kDecompressedSize);
strm.next_out = reinterpret_cast<Byte*>(&data[0]);

Loading…
Cancel
Save