Skip to content

Commit dc5a43e

Browse files
committed
zlib 1.2.3.6
1 parent d004b04 commit dc5a43e

31 files changed

+1061
-2110
lines changed

CMakeLists.txt

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ check_include_file(stddef.h HAVE_STDDEF_H)
2121
# Check to see if we have large file support
2222
#
2323
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE)
24-
2524
# We add these other definitions here because CheckTypeSize.cmake
2625
# in CMake 2.4.x does not automatically do so and we want
2726
# compatibility with CMake 2.4.x.
@@ -34,9 +33,7 @@ endif()
3433
if(HAVE_STDDEF_H)
3534
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
3635
endif()
37-
3836
check_type_size(off64_t OFF64_T)
39-
4037
if(HAVE_OFF64_T)
4138
add_definitions(-D_LARGEFILE64_SOURCE)
4239
endif()
@@ -62,23 +59,6 @@ if(NOT HAVE_ERRNO_H)
6259
add_definitions(-DNO_ERRNO_H)
6360
endif()
6461

65-
#
66-
# Check for mmap support
67-
#
68-
set(mmap_test_code "
69-
#include <sys/types.h>
70-
#include <sys/mman.h>
71-
#include <sys/stat.h>
72-
caddr_t hello() {
73-
return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
74-
}
75-
int main() { return 0; }
76-
")
77-
check_c_source_compiles("${mmap_test_code}" USE_MMAP)
78-
if(USE_MMAP)
79-
add_definitions(-DUSE_MMAP)
80-
endif()
81-
8262
#
8363
# Create the zlibdefs.h file.
8464
# Note: we create it in CMAKE_CURRENT_SOURCE_DIR instead
@@ -88,7 +68,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zlibdefs.h.cmakein
8868
${CMAKE_CURRENT_SOURCE_DIR}/zlibdefs.h)
8969

9070
if(MSVC)
91-
set(CMAKE_DEBUG_POSTFIX "D")
71+
set(CMAKE_DEBUG_POSTFIX "d")
9272
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
9373
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
9474
endif()
@@ -130,15 +110,47 @@ set(ZLIB_SRCS
130110
trees.c
131111
uncompr.c
132112
zutil.c
113+
win32/zlib1.rc
133114
)
134115

116+
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
117+
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
118+
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([0-9A-Za-z.]+)\".*"
119+
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
120+
121+
if(MINGW)
122+
# This gets us DLL resource information when compiling on MinGW.
123+
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
124+
COMMAND windres.exe
125+
-D GCC_WINDRES
126+
-I ${CMAKE_CURRENT_SOURCE_DIR}
127+
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
128+
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
129+
set(ZLIB_SRCS ${ZLIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
130+
endif(MINGW)
131+
135132
add_library(zlib ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
136133
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
137-
set_target_properties(zlib PROPERTIES VERSION 1.2.3.4)
134+
138135
set_target_properties(zlib PROPERTIES SOVERSION 1)
136+
137+
if(NOT CYGWIN)
138+
# This property causes shared libraries on Linux to have the full version
139+
# encoded into their final filename. We disable this on Cygwin because
140+
# it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll
141+
# seems to be the default.
142+
#
143+
# This has no effect with MSVC, on that platform the version info for
144+
# the DLL comes from the resource file win32/zlib1.rc
145+
set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
146+
endif()
147+
139148
if(UNIX)
140-
# On unix like platforms the library is almost always called libz
149+
# On unix-like platforms the library is almost always called libz
141150
set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
151+
elseif(BUILD_SHARED_LIBS AND WIN32)
152+
# Creates zlib1.dll when building shared library version
153+
set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
142154
endif()
143155

144156
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )

ChangeLog

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11

22
ChangeLog file for zlib
33

4+
Changes in 1.2.3.6 (17 Jan 2010)
5+
- Avoid void * arithmetic in gzread.c and gzwrite.c
6+
- Make compilers happier with const char * for gz_error message
7+
- Avoid unused parameter warning in inflate.c
8+
- Avoid signed-unsigned comparison warning in inflate.c
9+
- Indent #pragma's for traditional C
10+
- Fix usage of strwinerror() in glib.c, change to gz_strwinerror()
11+
- Correct email address in configure for system options
12+
- Update make_vms.com and add make_vms.com to contrib/minizip [Zinser]
13+
- Update zlib.map [Brown]
14+
- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [T�r�k]
15+
- Apply various fixes to CMakeLists.txt [Lowman]
16+
- Add checks on len in gzread() and gzwrite()
17+
- Add error message for no more room for gzungetc()
18+
- Remove zlib version check in gzwrite()
19+
- Defer compression of gzprintf() result until need to
20+
- Use snprintf() in gzdopen() if available
21+
- Remove USE_MMAP configuration determination (only used by minigzip)
22+
- Remove examples/pigz.c (available separately)
23+
- Update examples/gun.c to 1.6
24+
425
Changes in 1.2.3.5 (8 Jan 2010)
526
- Add space after #if in zutil.h for some compilers
627
- Fix relatively harmless bug in deflate_fast() [Exarevsky]
@@ -21,6 +42,7 @@ Changes in 1.2.3.5 (8 Jan 2010)
2142
- Replace gzio.c with a new set of routines with the same functionality
2243
- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
2344
- Update contrib/minizip to 1.1b
45+
- Change gzeof() to return 0 on error instead of -1 to agree with zlib.h
2446

2547
Changes in 1.2.3.4 (21 Dec 2009)
2648
- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Makefile for zlib
2-
# Copyright (C) 1995-2006 Jean-loup Gailly.
2+
# Copyright (C) 1995-2010 Jean-loup Gailly.
33
# For conditions of distribution and use, see copyright notice in zlib.h
44

55
# To compile and test, type:
@@ -32,7 +32,7 @@ CPP=$(CC) -E
3232

3333
STATICLIB=libz.a
3434
SHAREDLIB=libz.so
35-
SHAREDLIBV=libz.so.1.2.3.5
35+
SHAREDLIBV=libz.so.1.2.3.6
3636
SHAREDLIBM=libz.so.1
3737
LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
3838

@@ -124,10 +124,10 @@ match.lo: match.S
124124
rm -f _match.s
125125

126126
example64.o: example.c zlib.h zconf.h zlibdefs.h
127-
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ $<
127+
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c
128128

129129
minigzip64.o: minigzip.c zlib.h zconf.h zlibdefs.h
130-
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ $<
130+
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c
131131

132132
.SUFFIXES: .lo
133133

Makefile.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Makefile for zlib
2-
# Copyright (C) 1995-2006 Jean-loup Gailly.
2+
# Copyright (C) 1995-2010 Jean-loup Gailly.
33
# For conditions of distribution and use, see copyright notice in zlib.h
44

55
# To compile and test, type:
@@ -32,7 +32,7 @@ CPP=$(CC) -E
3232

3333
STATICLIB=libz.a
3434
SHAREDLIB=libz.so
35-
SHAREDLIBV=libz.so.1.2.3.5
35+
SHAREDLIBV=libz.so.1.2.3.6
3636
SHAREDLIBM=libz.so.1
3737
LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
3838

@@ -124,10 +124,10 @@ match.lo: match.S
124124
rm -f _match.s
125125

126126
example64.o: example.c zlib.h zconf.h zlibdefs.h
127-
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ $<
127+
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c
128128

129129
minigzip64.o: minigzip.c zlib.h zconf.h zlibdefs.h
130-
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ $<
130+
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c
131131

132132
.SUFFIXES: .lo
133133

README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ZLIB DATA COMPRESSION LIBRARY
22

3-
zlib 1.2.3.5 is a general purpose data compression library. All the code is
3+
zlib 1.2.3.6 is a general purpose data compression library. All the code is
44
thread safe. The data format used by the zlib library is described by RFCs
55
(Request for Comments) 1950 to 1952 in the files
66
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
@@ -33,7 +33,7 @@ Mark Nelson <[email protected]> wrote an article about zlib for the Jan. 1997
3333
issue of Dr. Dobb's Journal; a copy of the article is available in
3434
http://dogma.net/markn/articles/zlibtool/zlibtool.htm
3535

36-
The changes made in version 1.2.3.5 are documented in the file ChangeLog.
36+
The changes made in version 1.2.3.6 are documented in the file ChangeLog.
3737

3838
Unsupported third party contributions are provided in directory "contrib".
3939

as400/zlib.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
* ZLIB.INC - Interface to the general purpose compression library
22
*
33
* ILE RPG400 version by Patrick Monnerat, DATASPHERE.
4-
* Version 1.2.3.5
4+
* Version 1.2.3.6
55
*
66
*
77
* WARNING:
@@ -22,8 +22,8 @@
2222
*
2323
* Versioning information.
2424
*
25-
D ZLIB_VERSION C '1.2.3.5'
26-
D ZLIB_VERNUM C X'1235'
25+
D ZLIB_VERSION C '1.2.3.6'
26+
D ZLIB_VERNUM C X'1236'
2727
*
2828
* Other equates.
2929
*

configure

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
7878
CC="$cc"
7979
SFLAGS="${CFLAGS-"-O3"} -fPIC"
8080
CFLAGS="${CFLAGS-"-O3"}"
81+
if test "${ZLIBGCCWARN}" = "YES"; then
82+
CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
83+
fi
8184
if test -z "$uname"; then
8285
uname=`(uname -s || echo unknown) 2>/dev/null`
8386
fi
@@ -154,8 +157,8 @@ else
154157
SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
155158
CFLAGS=${CFLAGS-"-O2"}
156159
LDSHARED=${LDSHARED-"ld"} ;;
157-
SunStudio\ 9*) SFLAGS=${CFLAGS-"-DUSE_MMAP -fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
158-
CFLAGS=${CFLAGS-"-DUSE_MMAP -fast -xtarget=ultra3 -xarch=v9b"}
160+
SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
161+
CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
159162
LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
160163
UNIX_System_V\ 4.2.0)
161164
SFLAGS=${CFLAGS-"-KPIC -O"}
@@ -173,7 +176,7 @@ else
173176
SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
174177
CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
175178
LDSHARED=${LDSHARED-"xlc -G"} ;;
176-
# send working options for other systems to support@gzip.org
179+
# send working options for other systems to zlib@gzip.org
177180
*) SFLAGS=${CFLAGS-"-O"}
178181
CFLAGS=${CFLAGS-"-O"}
179182
LDSHARED=${LDSHARED-"cc -shared"} ;;
@@ -488,22 +491,6 @@ else
488491
SFLAGS="$SFLAGS -DNO_ERRNO_H"
489492
fi
490493

491-
cat > $test.c <<EOF
492-
#include <sys/types.h>
493-
#include <sys/mman.h>
494-
#include <sys/stat.h>
495-
caddr_t hello() {
496-
return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
497-
}
498-
EOF
499-
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
500-
CFLAGS="$CFLAGS -DUSE_MMAP"
501-
SFLAGS="$SFLAGS -DUSE_MMAP"
502-
echo Checking for mmap support... Yes.
503-
else
504-
echo Checking for mmap support... No.
505-
fi
506-
507494
CPP=${CPP-"$CC -E"}
508495
case $CFLAGS in
509496
*ASMV*)

contrib/infback9/inftree9.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* inftree9.c -- generate Huffman trees for efficient decoding
2-
* Copyright (C) 1995-2008 Mark Adler
2+
* Copyright (C) 1995-2010 Mark Adler
33
* For conditions of distribution and use, see copyright notice in zlib.h
44
*/
55

@@ -9,7 +9,7 @@
99
#define MAXBITS 15
1010

1111
const char inflate9_copyright[] =
12-
" inflate9 1.2.3.5 Copyright 1995-2009 Mark Adler ";
12+
" inflate9 1.2.3.6 Copyright 1995-2010 Mark Adler ";
1313
/*
1414
If you use the zlib library in a product, an acknowledgment is welcome
1515
in the documentation of your product. If for some reason you cannot
@@ -64,7 +64,7 @@ unsigned short FAR *work;
6464
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
6565
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
6666
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
67-
133, 133, 133, 133, 144, 69, 199};
67+
133, 133, 133, 133, 144, 199, 70};
6868
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
6969
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
7070
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,

contrib/minizip/make_vms.com

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
$ if f$search("ioapi.h_orig") .eqs. "" then copy ioapi.h ioapi.h_orig
2+
$ open/write zdef vmsdefs.h
3+
$ copy sys$input: zdef
4+
$ deck
5+
#define unix
6+
#define fill_zlib_filefunc64_32_def_from_filefunc32 fillzffunc64from
7+
#define Write_Zip64EndOfCentralDirectoryLocator Write_Zip64EoDLocator
8+
#define Write_Zip64EndOfCentralDirectoryRecord Write_Zip64EoDRecord
9+
#define Write_EndOfCentralDirectoryRecord Write_EoDRecord
10+
$ eod
11+
$ close zdef
12+
$ copy vmsdefs.h,ioapi.h_orig ioapi.h
13+
$ cc/include=[--]/prefix=all ioapi.c
14+
$ cc/include=[--]/prefix=all miniunz.c
15+
$ cc/include=[--]/prefix=all unzip.c
16+
$ cc/include=[--]/prefix=all minizip.c
17+
$ cc/include=[--]/prefix=all zip.c
18+
$ link miniunz,unzip,ioapi,[--]libz.olb/lib
19+
$ link minizip,zip,ioapi,[--]libz.olb/lib
20+
$ mcr []minizip test minizip64_info.txt
21+
$ mcr []miniunz -l test.zip
22+
$ rename minizip64_info.txt; minizip64_info.txt_old
23+
$ mcr []miniunz test.zip
24+
$ delete test.zip;*
25+
$exit

contrib/vstudio/vc7/zlib.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#define IDR_VERSION1 1
44
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5-
FILEVERSION 1,2,3,5
6-
PRODUCTVERSION 1,2,3,5
5+
FILEVERSION 1,2,3,6
6+
PRODUCTVERSION 1,2,3,6
77
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
88
FILEFLAGS 0
99
FILEOS VOS_DOS_WINDOWS32
@@ -17,12 +17,12 @@ BEGIN
1717

1818
BEGIN
1919
VALUE "FileDescription", "zlib data compression library\0"
20-
VALUE "FileVersion", "1.2.3.5\0"
20+
VALUE "FileVersion", "1.2.3.6\0"
2121
VALUE "InternalName", "zlib\0"
2222
VALUE "OriginalFilename", "zlib.dll\0"
2323
VALUE "ProductName", "ZLib.DLL\0"
2424
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25-
VALUE "LegalCopyright", "(C) 1995-2006 Jean-loup Gailly & Mark Adler\0"
25+
VALUE "LegalCopyright", "(C) 1995-2010 Jean-loup Gailly & Mark Adler\0"
2626
END
2727
END
2828
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)