[Zlib-devel] Modification on http://www.cs.toronto.edu/~cosmin/pngtech/zlib/zlib-1.2.0.f-cos1.tar.gz to build easily my STDCALL DLL without disturb anyone

Gilles Vollant info at winimage.com
Mon Jul 28 11:51:03 EDT 2003


As I said before,
http://www.cs.toronto.edu/~cosmin/pngtech/zlib/zlib-1.2.0.f-cos0.tar.gz  is
good for me.
 
 
But if you work on
http://www.cs.toronto.edu/~cosmin/pngtech/zlib/zlib-1.2.0.f-cos1.tar.gz  ,
we will need select one or two modification
 
1) http://www.winimage.com/zLibDll/gvpat1cos1zlib1203.zip 
or
2) http://www.winimage.com/zLibDll/gvpat2cos1zlib1203.zip 
 
 
in both 1) and 2), I modified zconf.h from zlib-1.2.0.f-cos1.tar.gz to
accept a define option, ZLIB_DLL_STDCALL
If ZLIB_DLL_STDCALL is not defined, my modification does nothing
If ZLIB_DLL_STDCALL is defined, I have a way to build my STDCALL library

ZLIB_DLL_STDCALL is without ambiguity and have never used before, I really
think this cannot disturb anyone.

And I modified my Visual C++ 7.0 project (.vcproj file) to define
ZLIB_DLL_STDCALL 

In the 2) option, I added another modification : rename my Win32
STDCALL/WinApi DLL as zlibwapi.dll to avoid name conflict (because there was
several zlib.dll incompatible outside)



For information, my diff on zconf.h from zlib-1.2.0.f-cos1.tar.gz 

*** zconforg.h  Sat Jul 26 03:17:55 2003
--- zconf.h     Mon Jul 28 18:15:44 2003
***************
*** 165,179 ****

  /* If building or using a DLL, compile with "-DZLIB_DLL". */
  #if defined(_WINDOWS) || defined(WINDOWS) || defined(WIN32)
! #  ifdef ZLIB_DLL
  #    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >=
0x500))
       /* This is a Win32-compliant compiler. */
  #      ifdef ZLIB_INTERNAL
  #        define ZEXTERN extern __declspec(dllexport)
  #      else
  #        define ZEXTERN extern __declspec(dllimport)
  #      endif
! #    else
       /* This is an old Windows compiler. */
       /* It must NOT be used to build the standard ZLIB1.DLL for Win32. */
  #      ifdef FAR
--- 165,183 ----

  /* If building or using a DLL, compile with "-DZLIB_DLL". */
  #if defined(_WINDOWS) || defined(WINDOWS) || defined(WIN32)
! #  if defined (ZLIB_DLL) || defined(ZLIB_DLL_STDCALL)
  #    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >=
0x500))
       /* This is a Win32-compliant compiler. */
+ #      ifdef ZLIB_DLL_STDCALL
+ #          define ZEXPORT   __stdcall
+ #          define ZEXPORTVA __cdecl
+ #      endif
  #      ifdef ZLIB_INTERNAL
  #        define ZEXTERN extern __declspec(dllexport)
  #      else
  #        define ZEXTERN extern __declspec(dllimport)
  #      endif
! #      else
       /* This is an old Windows compiler. */
       /* It must NOT be used to build the standard ZLIB1.DLL for Win32. */
  #      ifdef FAR
 





More information about the Zlib-devel mailing list