[Zlib-devel] zlib's Windows interface

Cosmin Truta cosmin at cs.toronto.edu
Sun May 25 03:04:01 EDT 2003


On Mon, 12 May 2003, Mark Adler wrote:

> Window washers,
>
> I was just beginning to go through a long series of emails on win32 and
> cdecl, etc.  Instead of trying to comprehend all of that (which might
> take a while since thankfully I have never done any development on a
> Windows system), could Cosmin, Dimitriy, Christian, and any other
> interested parties please let me know if you guys reached consensus on
> this, and if so, in what past or future email I could find the blessed
> patches?

Programming in C under Windows is not that bad, if you stay away
from the Windows' idiosyncrasies, or if you use them in a way that
does not disturb others (which, unfortunately, did not happen in
zlib). One way or another, you can write non-portable or otherwise
incompatible code, under any platform or environment.


[I am cc:ing this to Christian, in case he is interested in the
 discussion. Christian, if you are busy with other things, please
 just tell so.]


I wrote a thorough analysis of the Win32/DLL issue, including
detailed pros and cons to every decision. It's in a FAQ form,
because I have the impression that people read it more easily
this way.

That will basically constitute the specification of ZLIB.DLL.
Which means that we all have to agree on it first, and we will
start implementing the details only after.

  http://www.cs.toronto.edu/~cosmin/pngtech/zlib/zlib_dll.faq

After everything is finished (agreement + implementation), I
recommend including this FAQ in the upcoming zlib distributions.


Right now, I am proposing to revert the behavior to the zlib-1.1.4
status, because both STDCALL and CDECL seem to be needed. This
upsets Christian's wish to build both the static and the dynamic
library with the same options, but I think that the ease of making
builds is less motivated than the ease of use. It's the same in
Linux, where you need to recompile all the sources with -fPIC option
in order to build shared objects.

Everyone is welcome to come with proposals, and to challenge any
issue presented in the above document.


> I apologize for my laziness on this topic, but I have two Mars launches
> coming up in a few weeks that are occupying my time.

Sure, Mark, make sure that those Mars vehicles are doing their job
smoothly! ;-)


Cosmin





More information about the Zlib-devel mailing list