Skip to content

Commit

Permalink
build: do not define ZLIB_CONST
Browse files Browse the repository at this point in the history
This define is not available in zlib prior to version 1.2.5.2. See
#9110 for details. Workaround the
build breakage reported by casting away const in src/inspector_agent.cc
instead.

PR-URL: #9122
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
  • Loading branch information
bradleythughes authored and rvagg committed Oct 18, 2016
1 parent 4613c22 commit 99e4eee
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions deps/zlib/zlib.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
{
'target_name': 'zlib',
'type': 'static_library',
'defines': [ 'ZLIB_CONST' ],
'sources': [
'adler32.c',
'compress.c',
Expand Down Expand Up @@ -45,7 +44,6 @@
'.',
],
'direct_dependent_settings': {
'defines': [ 'ZLIB_CONST' ],
'include_dirs': [
'.',
],
Expand Down Expand Up @@ -74,12 +72,10 @@
'direct_dependent_settings': {
'defines': [
'USE_SYSTEM_ZLIB',
'ZLIB_CONST',
],
},
'defines': [
'USE_SYSTEM_ZLIB',
'ZLIB_CONST',
],
'link_settings': {
'libraries': [
Expand Down
2 changes: 0 additions & 2 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,6 @@
}],
[ 'node_shared_zlib=="false"', {
'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
}, {
'defines': [ 'ZLIB_CONST' ],
}],

[ 'node_shared_http_parser=="false"', {
Expand Down
2 changes: 1 addition & 1 deletion src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 99e4eee

Please sign in to comment.