diff options
-rw-r--r-- | RepositoryExternal.mk | 5 | ||||
-rw-r--r-- | package/Library_package2.mk | 1 | ||||
-rw-r--r-- | sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx | 2 | ||||
-rw-r--r-- | solenv/gbuild/PrecompiledHeaders.mk | 1 | ||||
-rw-r--r-- | tools/source/zcodec/zcodec.cxx | 4 |
5 files changed, 9 insertions, 4 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 442ce9dd4d7c..6e732c94793b 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -348,6 +348,7 @@ ifneq ($(SYSTEM_ZLIB),) define gb_LinkTarget__use_zlib $(call gb_LinkTarget_add_defs,$(1),\ -DSYSTEM_ZLIB \ + -DZLIB_CONST \ ) $(call gb_LinkTarget_add_libs,$(1),-lz) @@ -365,6 +366,10 @@ else # !SYSTEM_ZLIB define gb_LinkTarget__use_zlib_multiarch $(if $(2),,$(call gb_Output_error,gb_LinkTarget__use_zlib_multiarch needs two arguments)) +$(call gb_LinkTarget_add_defs,$(1), \ + -DZLIB_CONST \ +) + $(call gb_LinkTarget_set_include,$(1),\ $(ZLIB_CFLAGS) \ $$(INCLUDE) \ diff --git a/package/Library_package2.mk b/package/Library_package2.mk index 0c6dc4419355..9bb7e3194b98 100644 --- a/package/Library_package2.mk +++ b/package/Library_package2.mk @@ -20,7 +20,6 @@ $(eval $(call gb_Library_use_sdk_api,package2)) $(eval $(call gb_Library_add_defs,package2,\ -DDLLIMPLEMENTATION_PACKAGE \ - -DZLIB_CONST \ )) $(eval $(call gb_Library_set_precompiled_header,package2,package/inc/pch/precompiled_package2)) diff --git a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx index a6390f0157e9..798555fe2f54 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx @@ -86,7 +86,7 @@ sal_uInt32 PngHelper::deflateBuffer( const Output_t* i_pBuf, size_t i_nLen, Outp if (Z_OK != deflateInit(&aStream, Z_BEST_COMPRESSION)) return 0; aStream.avail_in = uInt(i_nLen); - aStream.next_in = const_cast<Bytef*>(i_pBuf); + aStream.next_in = i_pBuf; sal_uInt8 aOutBuf[ 32768 ]; do diff --git a/solenv/gbuild/PrecompiledHeaders.mk b/solenv/gbuild/PrecompiledHeaders.mk index 0d7ccf6610fb..d02668e1e930 100644 --- a/solenv/gbuild/PrecompiledHeaders.mk +++ b/solenv/gbuild/PrecompiledHeaders.mk @@ -142,6 +142,7 @@ gb_PrecompiledHeader_ignore_flags_system := \ -DSKIA_DLL \ -DGLM_FORCE_CTOR_INIT \ -DVCL_INTERNALS \ +-DZLIB_CONST \ -include $(SRCDIR)/pch/inc/clangfix.hxx \ # Probably also update pch/inc/clangfix.hxx if you extend the list. diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx index ce461d47ed0d..97a03a463021 100644 --- a/tools/source/zcodec/zcodec.cxx +++ b/tools/source/zcodec/zcodec.cxx @@ -122,7 +122,7 @@ void ZCodec::Compress( SvStream& rIStm, SvStream& rOStm ) for (;;) { pStream->next_in = mpInBuf.get(); - pStream->avail_in = rIStm.ReadBytes( pStream->next_in, mnInBufSize ); + pStream->avail_in = rIStm.ReadBytes( mpInBuf.get(), mnInBufSize ); if (pStream->avail_in == 0) break; if ( pStream->avail_out == 0 ) @@ -183,7 +183,7 @@ void ZCodec::Write( SvStream& rOStm, const sal_uInt8* pData, sal_uInt32 nSize ) auto pStream = static_cast<z_stream*>(mpsC_Stream); pStream->avail_in = nSize; - pStream->next_in = const_cast<unsigned char*>(pData); + pStream->next_in = pData; while ( pStream->avail_in || ( pStream->avail_out == 0 ) ) { |