Skip to content

Commit 99e4eee

Browse files
bradleythughesrvagg
authored andcommitted
build: do not define ZLIB_CONST
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>
1 parent 4613c22 commit 99e4eee

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

deps/zlib/zlib.gyp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
{
1313
'target_name': 'zlib',
1414
'type': 'static_library',
15-
'defines': [ 'ZLIB_CONST' ],
1615
'sources': [
1716
'adler32.c',
1817
'compress.c',
@@ -45,7 +44,6 @@
4544
'.',
4645
],
4746
'direct_dependent_settings': {
48-
'defines': [ 'ZLIB_CONST' ],
4947
'include_dirs': [
5048
'.',
5149
],
@@ -74,12 +72,10 @@
7472
'direct_dependent_settings': {
7573
'defines': [
7674
'USE_SYSTEM_ZLIB',
77-
'ZLIB_CONST',
7875
],
7976
},
8077
'defines': [
8178
'USE_SYSTEM_ZLIB',
82-
'ZLIB_CONST',
8379
],
8480
'link_settings': {
8581
'libraries': [

node.gyp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,6 @@
477477
}],
478478
[ 'node_shared_zlib=="false"', {
479479
'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
480-
}, {
481-
'defines': [ 'ZLIB_CONST' ],
482480
}],
483481

484482
[ 'node_shared_http_parser=="false"', {

src/inspector_agent.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void SendProtocolJson(InspectorSocket* socket) {
176176
PROTOCOL_JSON[0] * 0x10000u +
177177
PROTOCOL_JSON[1] * 0x100u +
178178
PROTOCOL_JSON[2];
179-
strm.next_in = PROTOCOL_JSON + 3;
179+
strm.next_in = const_cast<uint8_t*>(PROTOCOL_JSON + 3);
180180
strm.avail_in = sizeof(PROTOCOL_JSON) - 3;
181181
std::vector<char> data(kDecompressedSize);
182182
strm.next_out = reinterpret_cast<Byte*>(&data[0]);

0 commit comments

Comments
 (0)