From 99e4eee8ef070102c5656f1b60caf5a9d86a73c3 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Sun, 16 Oct 2016 13:45:33 +0000 Subject: [PATCH] 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 Reviewed-By: Colin Ihrig Reviewed-By: Rod Vagg --- deps/zlib/zlib.gyp | 4 ---- node.gyp | 2 -- src/inspector_agent.cc | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/deps/zlib/zlib.gyp b/deps/zlib/zlib.gyp index 65133d5fce..cf0b090d9e 100644 --- a/deps/zlib/zlib.gyp +++ b/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': [ diff --git a/node.gyp b/node.gyp index b686788a82..4043269930 100644 --- a/node.gyp +++ b/node.gyp @@ -477,8 +477,6 @@ }], [ 'node_shared_zlib=="false"', { 'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ], - }, { - 'defines': [ 'ZLIB_CONST' ], }], [ 'node_shared_http_parser=="false"', { diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index fdc8819286..740565444e 100644 --- a/src/inspector_agent.cc +++ b/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(PROTOCOL_JSON + 3); strm.avail_in = sizeof(PROTOCOL_JSON) - 3; std::vector data(kDecompressedSize); strm.next_out = reinterpret_cast(&data[0]);