[Zlib-devel] zlib 1.2.0.1 available for testing

Gilles Vollant info at winimage.com
Sun Mar 23 17:10:01 EST 2003


<<
In my previous email I explained why there is no ZLIB.DLL compatibility
to talk about. And in my first email on this issue I explained why there
will _never_ be a _compatible_ ZLIB.DLL>>
I read again previous email
OK, I'll say : in the future, I'll build zlib.dll compatible with my
previous zlib.dll

Pehaps the best solution is build several DLL with different name : one
with CDECL convention (compatible with the DLL made using the
nt/makefile), another with WINAPI convention (compatible with my DLL).
So futures apps will not have DLL compatibility problem.


Just an historic point : I had not created ZLIB.DLL with WINAPI. This
was Alessandro Iacopetti, and I maintain now this DLL after he stop
maintain it.

<<you will have to have one for static-singlethreaded, one for
static-multithreaded, and one to link with MSVCRT.DLL. All of these are
mutually incompatible. And I didn't mention the non-Microsoft Win32
platforms...>>
I don't agree. The way the DLL itself get the C runtime library did not
made compatibility problem.
Just for info, my zlib.dll uses C runtime from CRTDLL.DLL (an old DLL
with C Runtime, found in all version of Win32).
I don't make a DLL that need   MSVCRT.DLL or MSVCRT70.DLL because somes
users don't have these DLL


My suggestion :
I agree on remove the three line I added:
<<
#if defined(WIN32) && (!defined(ZLIB_WIN32_NODLL)) &&
(!defined(ZLIB_DLL))
#  define ZLIB_DLL
#endif
>>
Which broke compatibility. And I'm sorry for these line.


In Cosmin proposal, replace:
<<
#ifdef ZLIB_DLL
#  if defined(_WINDOWS) || defined(WINDOWS) || defined(WIN32)
#    include <windows.h>
#    ifndef WINAPIV
#      ifdef FAR
#        undef FAR
#      endif
#    endif
#    ifdef WIN32
#      if !(defined(__BORLANDC__) && (__BORLANDC__ < 0x500))
#        ifdef ZLIB_INTERNAL
#          define ZEXPORT  CDECL __declspec(dllexport)
#          define ZEXPORTVA  CDECL __declspec(dllexport)
#        else
#          define ZEXPORT  CDECL __declspec(dllimport)
#          define ZEXPORTVA  CDECL __declspec(dllimport)
#        endif
#      endif
#    else
#      define ZEXPORT  WINAPI _export
#      define ZEXPORTVA  FAR _cdecl _export
#    endif
#  endif
#endif
>>

By anything like

#if defined(ZLIB_DLL_CDECL) | defined (ZLIB_DLL_STDCALL)
#  if defined(_WINDOWS) || defined(WINDOWS) || defined(WIN32)
#    include <windows.h>
#    ifndef WINAPIV
#      ifdef FAR
#        undef FAR
#      endif
#    endif
#    ifdef WIN32
#      if !(defined(__BORLANDC__) && (__BORLANDC__ < 0x500))
#        ifdef ZLIB_INTERNAL
#          ifdef ZLIB_DLL_STDCALL
#            define ZEXPORT  STDCALL __declspec(dllexport)
#          else
#            define ZEXPORT  CDECL __declspec(dllexport)
#          endif
#          define ZEXPORTVA  CDECL __declspec(dllexport)
#        else
#          ifdef ZLIB_DLL_STDCALL
#            define ZEXPORT  STDCALL __declspec(dllimport)
#          else
#            define ZEXPORT  CDECL __declspec(dllimport)
#          endif
#          define ZEXPORTVA  CDECL __declspec(dllimport)
#        endif
#      endif
#    else
#      define ZEXPORT  WINAPI _export
#      define ZEXPORTVA  FAR _cdecl _export
#    endif
#  endif
#endif


I've another question : can we say that, actually, ZLIB_DLL is always
uses to "uses the zlib.dll with WINAPI calling" ?





More information about the Zlib-devel mailing list