[Zlib-devel] Updates to zlib 1.2.0.3 - pick one
Cosmin Truta
cosmin at cs.toronto.edu
Sun Jul 27 21:47:02 EDT 2003
Hi,
At last, I am able to provide my latest zlib patches.
Luckily, I succeeded to finish the transition to the new DLL interface.
Mark, I think the pick is up to you. My recommendation is to pick
the latter. I admit the argumentations I brought in "win32/DLL_FAQ.txt"
(which exists in both archives, but with a different contents) may be
biased and express my own point of view, but the pros and cons are
illustrated as clearly and as completely as possible.
So pick one:
http://www.cs.toronto.edu/~cosmin/pngtech/zlib/zlib-1.2.0.f-cos0.tar.gz
http://www.cs.toronto.edu/~cosmin/pngtech/zlib/zlib-1.2.0.f-cos1.tar.gz
zlib-1.2.0.f-cos0 is the update applied to zlib-1.2.0.3 that maintains
the old CDECL-for-static, STDCALL-for-DLL policy;
zlib-1.2.0.f-cos1 is the update applied to the same zlib-1.2.0.3 that
introduces the new CDECL-for-all policy.
I did not provide a diff file, but you can run diff against zlib-1.2.0.3
and see the changes.
**
Here is the summary of changes that apply to both archives:
- Replaced "java.util.zip class" with "java.util.zip package" in "FAQ".
- Replaced 32768 with 32768U in deflate.c, for 16-bit friendliness:
--- zlib-1.2.0.3/deflate.c Sun Jul 13 10:28:06 2003
+++ zlib-1.2.0.f-cos1/deflate.c Wed Jul 23 14:38:58 2003
@@ -1361,7 +1361,7 @@
/* longest_match() or longest_match_fast() sets match_start */
if (s->match_length <= 5 && (s->strategy == Z_FILTERED
-#if TOO_FAR < 32768
+#if TOO_FAR < 32768U
|| (s->match_length == MIN_MATCH &&
s->strstart - s->match_start > TOO_FAR)
- Added support for showing the ASMV flag in zlibCompileFlags();
I used bit 9 to indicate ASMV, but you can change this if you want.
--- zlib-1.2.0.3/zutil.c Sun Jul 13 00:46:27 2003
+++ zlib-1.2.0.f-cos1/zutil.c Sun Jul 27 12:59:00 2003
@@ -65,6 +65,9 @@
#ifdef DEBUG
flags += 1 << 8;
#endif
+#ifdef ASMV
+ flags += 1 << 9;
+#endif
#ifdef BUILDFIXED
flags += 1 << 12;
#endif
- Updated the "msdos/" directory; added Christian Spieler's makefiles;
tested the Turbo C and Borland C makefiles.
- Removed their correspondents from the "old/msdos/" directory.
- Updated the "win32/" directory; added "win32/makefile.emx".
Note 1: Christian's old makefiles that were building the DLL assumed
that the same options can be used to build the DLL and the static lib.
Therefore, they did not work here and I restored the old, separate
"win32/makefile.msc" and "win32/make-dll.msc".
Note 2: I could not test "win32/makefile.emx", but I trusted that
Christian's "msdos/makefile.emx" works, and I made the proper change
(try "diff -u msdos/makefile.emx win32/makefile.emx")
The old "old/nt/makefile.emx" suffered from a particular problem that
was obvious.
- Updated "win32/makefile-dll.msc" and renamed to "win32/make-dll.msc".
- Removed the entire "old/nt/" directory.
- Moved "contrib/zlib_dll_faq.txt" to "win32/DLL_FAQ.txt".
You can put this file back into "contrib/" if you want, although I
would recommend to keep it into "win32/". That file is a piece of
documentation that explains what happens and why is it happening
with the portions of zlib that deal with the Win32 platform.
- Updated zconf.h and zconf.in.h
- In zlib-...-cos0, it does the same thing, but it is a little
simplified, and it avoids the inclusion of <windows.h> and the
implied namespace pollution.
- In zlib-...-cos1, it is changed, to accomodate the new DLL
interface. The interface to static linking remains the same
(CDECL-based).
- Changes into "contrib/minizip/"
- Changed the ZCR_SEED2 constant in "crypt.h"; the old expression was
clumsy, and caused warnings on gcc.
--- zlib-1.2.0.3/contrib/minizip/crypt.h Sun Mar 16 03:22:00 2003
+++ zlib-1.2.0.f-cos0/contrib/minizip/crypt.h Sun Jul 27 19:47:48 2003
@@ -56,7 +56,7 @@
#define RAND_HEAD_LEN 12
/* "last resort" source for second part of crypt seed pattern */
# ifndef ZCR_SEED2
-# define ZCR_SEED2 (unsigned long)3141592654L /* use PI as default pattern */
+# define ZCR_SEED2 3141592654UL /* use PI as the default pattern */
# endif
- Included <windows.h> into "iowin32.h"; otherwise, "minizip.c" and
"minunz.c", that use Windows stuff, would not compile.
- Converted all files from DOS-style line endings "\r\n" to
Unix-style line endings "\n", for consistency with the rest of
the archive.
- Changes into "contrib/untgz/"
- Fixed "untgz.c"; it used some Windows stuff without including
<windows.h>
- Fixed "Makefile"; it did not run "../../configure" before building
"../../libz.a"
- Added "Makefile.msc" (Microsoft C)
- Renamed "Makefile.w32" to "Makefile.gccw32"; the old file name
was too broad. Actually, "Makefile" now works with both Cygwin
and MinGW, so you could as well remove "Makefile.gccw32".
**
Here is a summary of additional changes, that apply only to the latter
archive zlib-1.2.0.f-cos1:
- Updated "zconf.h" and "zconf.in.h".
- Updated the "win32/" directory. Now the makefiles "makefille.msc" and
"makefile.gcc" can build both the static library and the DLL.
- It is still possible to build the DLL using a different convention.
You only have to add "-DZEXPORT=__stdcall", or "-DZEXPORT=__fastcall",
into the makefile. See "contrib/delphi/zlib.mak" for an example.
It is required, however, *not* to use the name ZLIB1.DLL if anything
changes.
- Now the ASM versions of longest_match() work:
$ cp contrib/asm686/match.S match.S
# or
$ cp contrib/asm586/match.S match.S
$ ./configure; make "CFLAGS=-O3 -DASMV" OBJA=match.o
# or
$ make CFLAGS=-DASMV OBJA=match.o -f win32/makefile.gcc
They are capable to build the DLL, too. Tested with MinGW and Cygwin.
- Updated the "contrib/delphi/" and "contrib/delphi2/" directories.
The ZLib unit from "contrib/delphi2/" can replace the official ZLib
unit, supplied by Borland with Delphi and C++ Builder.
Tested with Delphi 6.
**
To Gilles:
The "contrib/vstudio/" projects and files still suffer from a couple of
problems. I didn't do anything to it, because it's your decision.
- The DEF file used to build ZLIB.DLL includes unofficial exports.
You can either fix the DEF file, or use a name different than
"ZLIB.DLL" or "ZLIB1.DLL" for the compiled DLL.
- The project requires a library file "crtdll.lib" that does not exist
in that directory, and there is no doc indicating where to get it
from. Instead of putting that file in there, I would suggest to drop
the dependency of CRTDLL.DLL completely. The problems related to it
are explained in "win32/DLL_FAQ.txt".
- In zlib-...-cos1, the ASM interface is now unified with the rest of
the sources compiled with CDECL. I think it's a good idea to adapt
your ASM files and to put them into "contrib/asm686/", so that they
can work like the rest, and are available to all the other makefiles.
**
To Mark:
I think it's enough for you to replace the private version notes at the
beginning of "zlib.h", and to make the release candidate "zlib-1.2.0.4"
as-is. If you want to move files around, and rebuild the directory
structure yourself, please make sure that the directories "msdos/" and
"win32/" are intact (but you can move DLL_FAQ.txt into "contrib/" if
you want). More importantly, do not intermix files between
zlib-...-cos0 and zlib-...-cos1. Although many have identical names,
some of them cannot be safely moved from one archive to another.
**
I will send a note about the DLL interface change to some interested
discussion lists right away.
Best regards,
Cosmin
More information about the Zlib-devel
mailing list