[Zlib-devel] WINAPIV under gcc 2.8.1
Cosmin Truta
cosmin at cs.toronto.edu
Sun Mar 23 17:10:03 EST 2003
On Sat, 22 Mar 2003, Dmitriy Anisimkov wrote:
> There is a problem with compilation ZLib 1.2.0.1 under gcc 2.8.1 in Win32
> platform.
>
> zlib.h:898: parse error before `gzprintf'
>
> I guess it is becouse 2.8.1 know nothing about WINAPIV macros,
> i did preprocess of the zlib.h and see
>
> extern int WINAPIV gzprintf (gzFile file, const char *format, ...) ;
>
> Could we avoid WINAPIV usage ?
>
> ZLib 1.1.4 is compiled fine under gcc 2.8.1.
The DLL-specific attributes are enabled by default in zlib-1.2.0.1 for
Win32. Until we resolve the issues of disabling vs. enabling ZLIB_DLL by
default, and of CDECL vs. STDCALL, you can define ZLIB_WIN32_NODLL
before including zlib.h.
> I have to use gcc 2.8.1 becouse public version of Ada95 compiler GNAT is GCC
> 2.8.1 based.
I was about to recommend you to upgrade to a newer gcc/Win32, because
the Win32 support in gcc-2.8.1 was incomplete, but now I understand you
may have to stick to it. WINAPIV is part of the standard Win32 API, and
due to the incomplete Win32 support in gcc-2.8.1, it doesn't work.
Adding the following line
#define WINAPIV CDECL
below the definition of WINAPI in "windef.h" shouldn't hurt, I think,
if you make sure that CDECL is defined first.
You may try to upgrade the gcc/Win32 distribution with a new one that is
compatible to your Ada95 environment. I think that Mumit Khan's
gcc-2.95.2-crtdll for MinGW may fit your purpose:
http://www.nanotech.wisc.edu/~khan/software/gnu-win32/gcc.html
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95.2/
but I cannot guarantee it. So if you decide to try an upgrade,
I strongly recommend you to back up your existing installation.
Best regards,
Cosmin
More information about the Zlib-devel
mailing list