mirror of https://github.com/madler/zlib
Compile the gzopen_w() function when __CYGWIN__ defined.
This commit is contained in:
parent
2fc6d66797
commit
b4ce6caf09
4
gzguts.h
4
gzguts.h
|
@ -39,6 +39,10 @@
|
||||||
# include <io.h>
|
# include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
|
# define WIDECHAR
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WINAPI_FAMILY
|
#ifdef WINAPI_FAMILY
|
||||||
# define open _open
|
# define open _open
|
||||||
# define read _read
|
# define read _read
|
||||||
|
|
8
gzlib.c
8
gzlib.c
|
@ -188,7 +188,7 @@ local gzFile gz_open(path, fd, mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save the path name for error messages */
|
/* save the path name for error messages */
|
||||||
#ifdef _WIN32
|
#ifdef WIDECHAR
|
||||||
if (fd == -2) {
|
if (fd == -2) {
|
||||||
len = wcstombs(NULL, path, 0);
|
len = wcstombs(NULL, path, 0);
|
||||||
if (len == (size_t)-1)
|
if (len == (size_t)-1)
|
||||||
|
@ -202,7 +202,7 @@ local gzFile gz_open(path, fd, mode)
|
||||||
free(state);
|
free(state);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#ifdef WIDECHAR
|
||||||
if (fd == -2)
|
if (fd == -2)
|
||||||
if (len)
|
if (len)
|
||||||
wcstombs(state->path, path, len + 1);
|
wcstombs(state->path, path, len + 1);
|
||||||
|
@ -239,7 +239,7 @@ local gzFile gz_open(path, fd, mode)
|
||||||
|
|
||||||
/* open the file with the appropriate flags (or just use fd) */
|
/* open the file with the appropriate flags (or just use fd) */
|
||||||
state->fd = fd > -1 ? fd : (
|
state->fd = fd > -1 ? fd : (
|
||||||
#ifdef _WIN32
|
#ifdef WIDECHAR
|
||||||
fd == -2 ? _wopen(path, oflag, 0666) :
|
fd == -2 ? _wopen(path, oflag, 0666) :
|
||||||
#endif
|
#endif
|
||||||
open((const char *)path, oflag, 0666));
|
open((const char *)path, oflag, 0666));
|
||||||
|
@ -303,7 +303,7 @@ gzFile ZEXPORT gzdopen(fd, mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -- see zlib.h -- */
|
/* -- see zlib.h -- */
|
||||||
#ifdef _WIN32
|
#ifdef WIDECHAR
|
||||||
gzFile ZEXPORT gzopen_w(path, mode)
|
gzFile ZEXPORT gzopen_w(path, mode)
|
||||||
const wchar_t *path;
|
const wchar_t *path;
|
||||||
const char *mode;
|
const char *mode;
|
||||||
|
|
2
zlib.h
2
zlib.h
|
@ -1757,7 +1757,7 @@ ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
|
||||||
ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
|
ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
|
||||||
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
||||||
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
||||||
#if defined(_WIN32) && !defined(Z_SOLO)
|
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
|
||||||
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
||||||
const char *mode));
|
const char *mode));
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue