ZipStream: do not #include "zutil.h"
The header explicitly say applications should NOT include it.
This change is required to allow using system-provided zlib.
--- a/ZipStream.st Thu Jul 09 21:48:49 2020 +0100
+++ b/ZipStream.st Tue Aug 25 09:35:11 2020 +0100
@@ -15,7 +15,7 @@
CompressionStream subclass:#ZipStream
instanceVariableNames:''
- classVariableNames:'Z_DEFLATED HEAD_OS_CODE HEAD_RESERVED HEAD_EXTRA_FIELD
+ classVariableNames:'Z_DEFLATED HEAD_RESERVED HEAD_EXTRA_FIELD
HEAD_ORIG_NAME HEAD_COMMENT HEAD_CRC GZ_MAGIC_ID'
poolDictionaries:''
category:'Streams-Compressed'
@@ -28,8 +28,8 @@
* includes, defines, structure definitions
* and typedefs come here.
*/
-#include "zlib.h"
-#include "zutil.h"
+#include <string.h>
+#include <zlib.h>
typedef enum {
e_opmode_unspecified /* processing done */
@@ -148,12 +148,10 @@
|z_deflated os_code|
%{
z_deflated = __MKSMALLINT( Z_DEFLATED );
- os_code = __MKSMALLINT( OS_CODE );
%}.
Z_DEFLATED := z_deflated.
- HEAD_OS_CODE := os_code.
HEAD_RESERVED := 16rE0. " bits 5..7: reserved "
HEAD_EXTRA_FIELD := 16r04. " bit 2 set: extra field present "
HEAD_ORIG_NAME := 16r08. " bit 3 set: original file name present "
@@ -500,7 +498,7 @@
, __intVal( level )
, Z_DEFLATED
, __intVal( windowBits )
- , DEF_MEM_LEVEL
+ , 8
, Z_DEFAULT_STRATEGY
);
@@ -698,7 +696,7 @@
OBJ _outObj = __INST( outputBytes );
OBJ _inpObj = __INST( inputBytes );
- zmemzero( _zstream, sizeof(zstream_s) );
+ memset( _zstream, 0, sizeof(zstream_s) );
_zstream->in_ref = (Bytef *) __externalBytesAddress( _inpObj );
_zstream->stream.next_in = Z_NULL;
@@ -851,7 +849,7 @@
].
"write OS code"
- onStream nextPutByte:HEAD_OS_CODE.
+ onStream nextPutByte:3."assume Unix"
! !
!ZipStream class methodsFor:'documentation'!