mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
(zlib) Build fixes - who knew making this shit portable would
be so time-consuming?
This commit is contained in:
parent
a2d713b3cb
commit
05eaa7ade1
20
deps/rzlib/adler32.c
vendored
20
deps/rzlib/adler32.c
vendored
@ -62,10 +62,7 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
uLong ZEXPORT adler32(adler, buf, len)
|
||||
uLong adler;
|
||||
const Bytef *buf;
|
||||
uInt len;
|
||||
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len)
|
||||
{
|
||||
unsigned long sum2;
|
||||
unsigned n;
|
||||
@ -133,10 +130,7 @@ uLong ZEXPORT adler32(adler, buf, len)
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
local uLong adler32_combine_(adler1, adler2, len2)
|
||||
uLong adler1;
|
||||
uLong adler2;
|
||||
z_off64_t len2;
|
||||
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2)
|
||||
{
|
||||
unsigned long sum1;
|
||||
unsigned long sum2;
|
||||
@ -162,18 +156,12 @@ local uLong adler32_combine_(adler1, adler2, len2)
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
|
||||
uLong adler1;
|
||||
uLong adler2;
|
||||
z_off_t len2;
|
||||
uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2)
|
||||
{
|
||||
return adler32_combine_(adler1, adler2, len2);
|
||||
}
|
||||
|
||||
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
|
||||
uLong adler1;
|
||||
uLong adler2;
|
||||
z_off64_t len2;
|
||||
uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2)
|
||||
{
|
||||
return adler32_combine_(adler1, adler2, len2);
|
||||
}
|
||||
|
16
deps/rzlib/compress.c
vendored
16
deps/rzlib/compress.c
vendored
@ -19,12 +19,7 @@
|
||||
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
|
||||
Z_STREAM_ERROR if the level parameter is invalid.
|
||||
*/
|
||||
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
|
||||
Bytef *dest;
|
||||
uLongf *destLen;
|
||||
const Bytef *source;
|
||||
uLong sourceLen;
|
||||
int level;
|
||||
int ZEXPORT compress2 (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level)
|
||||
{
|
||||
z_stream stream;
|
||||
int err;
|
||||
@ -59,11 +54,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
|
||||
|
||||
/* ===========================================================================
|
||||
*/
|
||||
int ZEXPORT compress (dest, destLen, source, sourceLen)
|
||||
Bytef *dest;
|
||||
uLongf *destLen;
|
||||
const Bytef *source;
|
||||
uLong sourceLen;
|
||||
int ZEXPORT compress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
|
||||
{
|
||||
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
|
||||
}
|
||||
@ -72,8 +63,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
|
||||
If the default memLevel or windowBits for deflateInit() is changed, then
|
||||
this function needs to be updated.
|
||||
*/
|
||||
uLong ZEXPORT compressBound (sourceLen)
|
||||
uLong sourceLen;
|
||||
uLong ZEXPORT compressBound (uLong sourceLen)
|
||||
{
|
||||
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
|
||||
(sourceLen >> 25) + 13;
|
||||
|
130
deps/rzlib/deflate.c
vendored
130
deps/rzlib/deflate.c
vendored
@ -194,11 +194,7 @@ local const config configuration_table[10] = {
|
||||
zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflateInit_(strm, level, version, stream_size)
|
||||
z_streamp strm;
|
||||
int level;
|
||||
const char *version;
|
||||
int stream_size;
|
||||
int ZEXPORT deflateInit_(z_streamp strm, int level, const char *version, int stream_size)
|
||||
{
|
||||
return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
|
||||
Z_DEFAULT_STRATEGY, version, stream_size);
|
||||
@ -206,16 +202,8 @@ int ZEXPORT deflateInit_(strm, level, version, stream_size)
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
|
||||
version, stream_size)
|
||||
z_streamp strm;
|
||||
int level;
|
||||
int method;
|
||||
int windowBits;
|
||||
int memLevel;
|
||||
int strategy;
|
||||
const char *version;
|
||||
int stream_size;
|
||||
int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy,
|
||||
const char *version, int stream_size)
|
||||
{
|
||||
deflate_state *s;
|
||||
int wrap = 1;
|
||||
@ -316,10 +304,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
|
||||
z_streamp strm;
|
||||
const Bytef *dictionary;
|
||||
uInt dictLength;
|
||||
int ZEXPORT deflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt dictLength)
|
||||
{
|
||||
deflate_state *s;
|
||||
uInt str, n;
|
||||
@ -329,7 +314,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
|
||||
|
||||
if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL)
|
||||
return Z_STREAM_ERROR;
|
||||
s = strm->state;
|
||||
s = (deflate_state*)strm->state;
|
||||
wrap = s->wrap;
|
||||
if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
|
||||
return Z_STREAM_ERROR;
|
||||
@ -385,8 +370,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflateResetKeep (strm)
|
||||
z_streamp strm;
|
||||
int ZEXPORT deflateResetKeep (z_streamp strm)
|
||||
{
|
||||
deflate_state *s;
|
||||
|
||||
@ -420,21 +404,18 @@ int ZEXPORT deflateResetKeep (strm)
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflateReset (strm)
|
||||
z_streamp strm;
|
||||
int ZEXPORT deflateReset (z_streamp strm)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = deflateResetKeep(strm);
|
||||
if (ret == Z_OK)
|
||||
lm_init(strm->state);
|
||||
lm_init((deflate_state*)strm->state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflateSetHeader (strm, head)
|
||||
z_streamp strm;
|
||||
gz_headerp head;
|
||||
int ZEXPORT deflateSetHeader (z_streamp strm, gz_headerp head)
|
||||
{
|
||||
struct internal_state_deflate *state = (struct internal_state_deflate*)strm->state;
|
||||
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
|
||||
@ -445,10 +426,7 @@ int ZEXPORT deflateSetHeader (strm, head)
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflatePending (strm, pending, bits)
|
||||
unsigned *pending;
|
||||
int *bits;
|
||||
z_streamp strm;
|
||||
int ZEXPORT deflatePending (z_streamp strm, unsigned *pending, int *bits)
|
||||
{
|
||||
struct internal_state_deflate *state = (struct internal_state_deflate*)strm->state;
|
||||
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
|
||||
@ -460,16 +438,13 @@ int ZEXPORT deflatePending (strm, pending, bits)
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflatePrime (strm, bits, value)
|
||||
z_streamp strm;
|
||||
int bits;
|
||||
int value;
|
||||
int ZEXPORT deflatePrime (z_streamp strm, int bits, int value)
|
||||
{
|
||||
deflate_state *s;
|
||||
int put;
|
||||
|
||||
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
|
||||
s = strm->state;
|
||||
s = (deflate_state*)strm->state;
|
||||
if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
|
||||
return Z_BUF_ERROR;
|
||||
do {
|
||||
@ -486,17 +461,14 @@ int ZEXPORT deflatePrime (strm, bits, value)
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflateParams(strm, level, strategy)
|
||||
z_streamp strm;
|
||||
int level;
|
||||
int strategy;
|
||||
int ZEXPORT deflateParams(z_streamp strm, int level, int strategy)
|
||||
{
|
||||
deflate_state *s;
|
||||
compress_func func;
|
||||
int err = Z_OK;
|
||||
|
||||
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
|
||||
s = strm->state;
|
||||
s = (deflate_state*)strm->state;
|
||||
|
||||
#ifdef FASTEST
|
||||
if (level != 0) level = 1;
|
||||
@ -527,17 +499,12 @@ int ZEXPORT deflateParams(strm, level, strategy)
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
|
||||
z_streamp strm;
|
||||
int good_length;
|
||||
int max_lazy;
|
||||
int nice_length;
|
||||
int max_chain;
|
||||
int ZEXPORT deflateTune(z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)
|
||||
{
|
||||
deflate_state *s;
|
||||
|
||||
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
|
||||
s = strm->state;
|
||||
s = (deflate_state*)strm->state;
|
||||
s->good_match = good_length;
|
||||
s->max_lazy_match = max_lazy;
|
||||
s->nice_match = nice_length;
|
||||
@ -562,9 +529,7 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
|
||||
* upper bound of about 14% expansion does not seem onerous for output buffer
|
||||
* allocation.
|
||||
*/
|
||||
uLong ZEXPORT deflateBound(strm, sourceLen)
|
||||
z_streamp strm;
|
||||
uLong sourceLen;
|
||||
uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen)
|
||||
{
|
||||
deflate_state *s;
|
||||
uLong complen, wraplen;
|
||||
@ -579,7 +544,7 @@ uLong ZEXPORT deflateBound(strm, sourceLen)
|
||||
return complen + 6;
|
||||
|
||||
/* compute wrapper length */
|
||||
s = strm->state;
|
||||
s = (deflate_state*)strm->state;
|
||||
switch (s->wrap) {
|
||||
case 0: /* raw deflate */
|
||||
wraplen = 0;
|
||||
@ -624,9 +589,7 @@ uLong ZEXPORT deflateBound(strm, sourceLen)
|
||||
* IN assertion: the stream state is correct and there is enough room in
|
||||
* pending_buf.
|
||||
*/
|
||||
local void putShortMSB (s, b)
|
||||
deflate_state *s;
|
||||
uInt b;
|
||||
local void putShortMSB (deflate_state *s, uInt b)
|
||||
{
|
||||
put_byte(s, (Byte)(b >> 8));
|
||||
put_byte(s, (Byte)(b & 0xff));
|
||||
@ -638,11 +601,10 @@ local void putShortMSB (s, b)
|
||||
* to avoid allocating a large strm->next_out buffer and copying into it.
|
||||
* (See also read_buf()).
|
||||
*/
|
||||
local void flush_pending(strm)
|
||||
z_streamp strm;
|
||||
local void flush_pending(z_streamp strm)
|
||||
{
|
||||
unsigned len;
|
||||
deflate_state *s = strm->state;
|
||||
deflate_state *s = (deflate_state*)strm->state;
|
||||
|
||||
_tr_flush_bits(s);
|
||||
len = s->pending;
|
||||
@ -661,9 +623,7 @@ local void flush_pending(strm)
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflate (strm, flush)
|
||||
z_streamp strm;
|
||||
int flush;
|
||||
int ZEXPORT deflate (z_streamp strm, int flush)
|
||||
{
|
||||
int old_flush; /* value of flush param for previous deflate call */
|
||||
deflate_state *s;
|
||||
@ -672,7 +632,7 @@ int ZEXPORT deflate (strm, flush)
|
||||
flush > Z_BLOCK || flush < 0) {
|
||||
return Z_STREAM_ERROR;
|
||||
}
|
||||
s = strm->state;
|
||||
s = (deflate_state*)strm->state;
|
||||
|
||||
if (strm->next_out == Z_NULL ||
|
||||
(strm->next_in == Z_NULL && strm->avail_in != 0) ||
|
||||
@ -975,8 +935,7 @@ int ZEXPORT deflate (strm, flush)
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
int ZEXPORT deflateEnd (strm)
|
||||
z_streamp strm;
|
||||
int ZEXPORT deflateEnd (z_streamp strm)
|
||||
{
|
||||
struct internal_state_deflate *state;
|
||||
int status;
|
||||
@ -1012,9 +971,7 @@ int ZEXPORT deflateEnd (strm)
|
||||
* To simplify the source, this is not supported for 16-bit MSDOS (which
|
||||
* doesn't have enough memory anyway to duplicate compression states).
|
||||
*/
|
||||
int ZEXPORT deflateCopy (dest, source)
|
||||
z_streamp dest;
|
||||
z_streamp source;
|
||||
int ZEXPORT deflateCopy (z_streamp dest, z_streamp source)
|
||||
{
|
||||
#ifdef MAXSEG_64K
|
||||
return Z_STREAM_ERROR;
|
||||
@ -1028,7 +985,7 @@ int ZEXPORT deflateCopy (dest, source)
|
||||
return Z_STREAM_ERROR;
|
||||
}
|
||||
|
||||
ss = source->state;
|
||||
ss = (deflate_state*)source->state;
|
||||
|
||||
zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
|
||||
|
||||
@ -1074,10 +1031,7 @@ int ZEXPORT deflateCopy (dest, source)
|
||||
* allocating a large strm->next_in buffer and copying from it.
|
||||
* (See also flush_pending()).
|
||||
*/
|
||||
local int read_buf(strm, buf, size)
|
||||
z_streamp strm;
|
||||
Bytef *buf;
|
||||
unsigned size;
|
||||
local int read_buf(z_streamp strm, Bytef *buf, unsigned size)
|
||||
{
|
||||
struct internal_state_deflate *state = (struct internal_state_deflate*)strm->state;
|
||||
unsigned len = strm->avail_in;
|
||||
@ -1105,8 +1059,7 @@ local int read_buf(strm, buf, size)
|
||||
/* ===========================================================================
|
||||
* Initialize the "longest match" routines for a new zlib stream
|
||||
*/
|
||||
local void lm_init (s)
|
||||
deflate_state *s;
|
||||
local void lm_init (deflate_state *s)
|
||||
{
|
||||
s->window_size = (ulg)2L*s->w_size;
|
||||
|
||||
@ -1147,9 +1100,7 @@ local void lm_init (s)
|
||||
/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
|
||||
* match.S. The code will be functionally equivalent.
|
||||
*/
|
||||
local uInt longest_match(s, cur_match)
|
||||
deflate_state *s;
|
||||
IPos cur_match; /* current match */
|
||||
local uInt longest_match(deflate_state *s, IPos cur_match)
|
||||
{
|
||||
unsigned chain_length = s->max_chain_length;/* max hash chain length */
|
||||
register Bytef *scan = s->window + s->strstart; /* current string */
|
||||
@ -1389,8 +1340,7 @@ local void check_match(s, start, match, length)
|
||||
* performed for at least two bytes (required for the zip translate_eol
|
||||
* option -- not supported here).
|
||||
*/
|
||||
local void fill_window(s)
|
||||
deflate_state *s;
|
||||
local void fill_window(deflate_state *s)
|
||||
{
|
||||
register unsigned n, m;
|
||||
register Posf *p;
|
||||
@ -1563,9 +1513,7 @@ local void fill_window(s)
|
||||
* NOTE: this function should be optimized to avoid extra copying from
|
||||
* window to pending_buf.
|
||||
*/
|
||||
local block_state deflate_stored(s, flush)
|
||||
deflate_state *s;
|
||||
int flush;
|
||||
local block_state deflate_stored(deflate_state *s, int flush)
|
||||
{
|
||||
/* Stored blocks are limited to 0xffff bytes, pending_buf is limited
|
||||
* to pending_buf_size, and each stored block has a 5 byte header:
|
||||
@ -1627,9 +1575,7 @@ local block_state deflate_stored(s, flush)
|
||||
* new strings in the dictionary only for unmatched strings or for short
|
||||
* matches. It is used only for the fast compression options.
|
||||
*/
|
||||
local block_state deflate_fast(s, flush)
|
||||
deflate_state *s;
|
||||
int flush;
|
||||
local block_state deflate_fast(deflate_state *s, int flush)
|
||||
{
|
||||
IPos hash_head; /* head of the hash chain */
|
||||
int bflush; /* set if current block must be flushed */
|
||||
@ -1729,9 +1675,7 @@ local block_state deflate_fast(s, flush)
|
||||
* evaluation for matches: a match is finally adopted only if there is
|
||||
* no better match at the next window position.
|
||||
*/
|
||||
local block_state deflate_slow(s, flush)
|
||||
deflate_state *s;
|
||||
int flush;
|
||||
local block_state deflate_slow(deflate_state *s, int flush)
|
||||
{
|
||||
IPos hash_head; /* head of hash chain */
|
||||
int bflush; /* set if current block must be flushed */
|
||||
@ -1860,9 +1804,7 @@ local block_state deflate_slow(s, flush)
|
||||
* one. Do not maintain a hash table. (It will be regenerated if this run of
|
||||
* deflate switches away from Z_RLE.)
|
||||
*/
|
||||
local block_state deflate_rle(s, flush)
|
||||
deflate_state *s;
|
||||
int flush;
|
||||
local block_state deflate_rle(deflate_state *s, int flush)
|
||||
{
|
||||
int bflush; /* set if current block must be flushed */
|
||||
uInt prev; /* byte at distance one to match */
|
||||
@ -1933,9 +1875,7 @@ local block_state deflate_rle(s, flush)
|
||||
* For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
|
||||
* (It will be regenerated if this run of deflate switches away from Huffman.)
|
||||
*/
|
||||
local block_state deflate_huff(s, flush)
|
||||
deflate_state *s;
|
||||
int flush;
|
||||
local block_state deflate_huff(deflate_state *s, int flush)
|
||||
{
|
||||
int bflush; /* set if current block must be flushed */
|
||||
|
||||
|
3
deps/rzlib/gzclose.c
vendored
3
deps/rzlib/gzclose.c
vendored
@ -8,8 +8,7 @@
|
||||
/* gzclose() is in a separate file so that it is linked in only if it is used.
|
||||
That way the other gzclose functions can be used instead to avoid linking in
|
||||
unneeded compression or decompression routines. */
|
||||
int ZEXPORT gzclose(file)
|
||||
gzFile file;
|
||||
int ZEXPORT gzclose(gzFile file)
|
||||
{
|
||||
#ifndef NO_GZCOMPRESS
|
||||
gz_statep state;
|
||||
|
74
deps/rzlib/gzlib.c
vendored
74
deps/rzlib/gzlib.c
vendored
@ -72,8 +72,7 @@ char ZLIB_INTERNAL *gz_strwinerror (error)
|
||||
#endif /* UNDER_CE */
|
||||
|
||||
/* Reset gzip file state */
|
||||
local void gz_reset(state)
|
||||
gz_statep state;
|
||||
local void gz_reset(gz_statep state)
|
||||
{
|
||||
state->x.have = 0; /* no output data available */
|
||||
if (state->mode == GZ_READ) { /* for reading ... */
|
||||
@ -88,10 +87,7 @@ local void gz_reset(state)
|
||||
}
|
||||
|
||||
/* Open a gzip file either by name or file descriptor. */
|
||||
local gzFile gz_open(path, fd, mode)
|
||||
const void *path;
|
||||
int fd;
|
||||
const char *mode;
|
||||
local gzFile gz_open(const void *path, int fd, const char *mode)
|
||||
{
|
||||
gz_statep state;
|
||||
size_t len;
|
||||
@ -190,7 +186,7 @@ local gzFile gz_open(path, fd, mode)
|
||||
/* save the path name for error messages */
|
||||
#ifdef _WIN32
|
||||
if (fd == -2) {
|
||||
len = wcstombs(NULL, path, 0);
|
||||
len = wcstombs(NULL, (const wchar_t*)path, 0);
|
||||
if (len == (size_t)-1)
|
||||
len = 0;
|
||||
}
|
||||
@ -205,7 +201,7 @@ local gzFile gz_open(path, fd, mode)
|
||||
#ifdef _WIN32
|
||||
if (fd == -2)
|
||||
if (len)
|
||||
wcstombs(state->path, path, len + 1);
|
||||
wcstombs(state->path, (const wchar_t*)path, len + 1);
|
||||
else
|
||||
*(state->path) = 0;
|
||||
else
|
||||
@ -240,7 +236,7 @@ local gzFile gz_open(path, fd, mode)
|
||||
/* open the file with the appropriate flags (or just use fd) */
|
||||
state->fd = fd > -1 ? fd : (
|
||||
#ifdef _WIN32
|
||||
fd == -2 ? _wopen(path, oflag, 0666) :
|
||||
fd == -2 ? _wopen((const wchar_t*)path, oflag, 0666) :
|
||||
#endif
|
||||
open((const char *)path, oflag, 0666));
|
||||
if (state->fd == -1) {
|
||||
@ -265,25 +261,19 @@ local gzFile gz_open(path, fd, mode)
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
gzFile ZEXPORT gzopen(path, mode)
|
||||
const char *path;
|
||||
const char *mode;
|
||||
gzFile ZEXPORT gzopen(const char *path, const char *mode)
|
||||
{
|
||||
return gz_open(path, -1, mode);
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
gzFile ZEXPORT gzopen64(path, mode)
|
||||
const char *path;
|
||||
const char *mode;
|
||||
gzFile ZEXPORT gzopen64(const char *path, const char *mode)
|
||||
{
|
||||
return gz_open(path, -1, mode);
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
gzFile ZEXPORT gzdopen(fd, mode)
|
||||
int fd;
|
||||
const char *mode;
|
||||
gzFile ZEXPORT gzdopen(int fd, const char *mode)
|
||||
{
|
||||
char *path; /* identifier for error messages */
|
||||
gzFile gz;
|
||||
@ -302,18 +292,14 @@ gzFile ZEXPORT gzdopen(fd, mode)
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
#ifdef _WIN32
|
||||
gzFile ZEXPORT gzopen_w(path, mode)
|
||||
const wchar_t *path;
|
||||
const char *mode;
|
||||
gzFile ZEXPORT gzopen_w(const wchar_t *path, const char *mode)
|
||||
{
|
||||
return gz_open(path, -2, mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
int ZEXPORT gzbuffer(file, size)
|
||||
gzFile file;
|
||||
unsigned size;
|
||||
int ZEXPORT gzbuffer(gzFile file, unsigned size)
|
||||
{
|
||||
gz_statep state;
|
||||
|
||||
@ -336,8 +322,7 @@ int ZEXPORT gzbuffer(file, size)
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
int ZEXPORT gzrewind(file)
|
||||
gzFile file;
|
||||
int ZEXPORT gzrewind(gzFile file)
|
||||
{
|
||||
gz_statep state;
|
||||
|
||||
@ -359,10 +344,7 @@ int ZEXPORT gzrewind(file)
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
z_off64_t ZEXPORT gzseek64(file, offset, whence)
|
||||
gzFile file;
|
||||
z_off64_t offset;
|
||||
int whence;
|
||||
z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence)
|
||||
{
|
||||
unsigned n;
|
||||
z_off64_t ret;
|
||||
@ -436,10 +418,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
z_off_t ZEXPORT gzseek(file, offset, whence)
|
||||
gzFile file;
|
||||
z_off_t offset;
|
||||
int whence;
|
||||
z_off_t ZEXPORT gzseek(gzFile file, z_off_t offset, int whence)
|
||||
{
|
||||
z_off64_t ret;
|
||||
|
||||
@ -448,8 +427,7 @@ z_off_t ZEXPORT gzseek(file, offset, whence)
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
z_off64_t ZEXPORT gztell64(file)
|
||||
gzFile file;
|
||||
z_off64_t ZEXPORT gztell64(gzFile file)
|
||||
{
|
||||
gz_statep state;
|
||||
|
||||
@ -465,8 +443,7 @@ z_off64_t ZEXPORT gztell64(file)
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
z_off_t ZEXPORT gztell(file)
|
||||
gzFile file;
|
||||
z_off_t ZEXPORT gztell(gzFile file)
|
||||
{
|
||||
z_off64_t ret;
|
||||
|
||||
@ -475,8 +452,7 @@ z_off_t ZEXPORT gztell(file)
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
z_off64_t ZEXPORT gzoffset64(file)
|
||||
gzFile file;
|
||||
z_off64_t ZEXPORT gzoffset64(gzFile file)
|
||||
{
|
||||
z_off64_t offset;
|
||||
gz_statep state;
|
||||
@ -498,8 +474,7 @@ z_off64_t ZEXPORT gzoffset64(file)
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
z_off_t ZEXPORT gzoffset(file)
|
||||
gzFile file;
|
||||
z_off_t ZEXPORT gzoffset(gzFile file)
|
||||
{
|
||||
z_off64_t ret;
|
||||
|
||||
@ -508,8 +483,7 @@ z_off_t ZEXPORT gzoffset(file)
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
int ZEXPORT gzeof(file)
|
||||
gzFile file;
|
||||
int ZEXPORT gzeof(gzFile file)
|
||||
{
|
||||
gz_statep state;
|
||||
|
||||
@ -525,9 +499,7 @@ int ZEXPORT gzeof(file)
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
const char * ZEXPORT gzerror(file, errnum)
|
||||
gzFile file;
|
||||
int *errnum;
|
||||
const char * ZEXPORT gzerror(gzFile file, int *errnum)
|
||||
{
|
||||
gz_statep state;
|
||||
|
||||
@ -546,8 +518,7 @@ const char * ZEXPORT gzerror(file, errnum)
|
||||
}
|
||||
|
||||
/* -- see zlib.h -- */
|
||||
void ZEXPORT gzclearerr(file)
|
||||
gzFile file;
|
||||
void ZEXPORT gzclearerr(gzFile file)
|
||||
{
|
||||
gz_statep state;
|
||||
|
||||
@ -572,10 +543,7 @@ void ZEXPORT gzclearerr(file)
|
||||
memory). Simply save the error message as a static string. If there is an
|
||||
allocation failure constructing the error message, then convert the error to
|
||||
out of memory. */
|
||||
void ZLIB_INTERNAL gz_error(state, err, msg)
|
||||
gz_statep state;
|
||||
int err;
|
||||
const char *msg;
|
||||
void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg)
|
||||
{
|
||||
/* free previously allocated message and clear */
|
||||
if (state->msg != NULL) {
|
||||
|
22
deps/rzlib/gzread.c
vendored
22
deps/rzlib/gzread.c
vendored
@ -17,11 +17,7 @@ local int gz_skip OF((gz_statep, z_off64_t));
|
||||
state->fd, and update state->eof, state->err, and state->msg as appropriate.
|
||||
This function needs to loop on read(), since read() is not guaranteed to
|
||||
read the number of bytes requested, depending on the type of descriptor. */
|
||||
local int gz_load(state, buf, len, have)
|
||||
gz_statep state;
|
||||
unsigned char *buf;
|
||||
unsigned len;
|
||||
unsigned *have;
|
||||
local int gz_load(gz_statep state, unsigned char *buf, unsigned len, unsigned *have)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -48,8 +44,7 @@ local int gz_load(state, buf, len, have)
|
||||
If strm->avail_in != 0, then the current data is moved to the beginning of
|
||||
the input buffer, and then the remainder of the buffer is loaded with the
|
||||
available data from the input file. */
|
||||
local int gz_avail(state)
|
||||
gz_statep state;
|
||||
local int gz_avail(gz_statep state)
|
||||
{
|
||||
unsigned got;
|
||||
z_streamp strm = &(state->strm);
|
||||
@ -83,8 +78,7 @@ local int gz_avail(state)
|
||||
case, all further file reads will be directly to either the output buffer or
|
||||
a user buffer. If decompressing, the inflate state will be initialized.
|
||||
gz_look() will return 0 on success or -1 on failure. */
|
||||
local int gz_look(state)
|
||||
gz_statep state;
|
||||
local int gz_look(gz_statep state)
|
||||
{
|
||||
z_streamp strm = &(state->strm);
|
||||
|
||||
@ -169,8 +163,7 @@ local int gz_look(state)
|
||||
data. If the gzip stream completes, state->how is reset to LOOK to look for
|
||||
the next gzip stream or raw data, once state->x.have is depleted. Returns 0
|
||||
on success, -1 on failure. */
|
||||
local int gz_decomp(state)
|
||||
gz_statep state;
|
||||
local int gz_decomp(gz_statep state)
|
||||
{
|
||||
int ret = Z_OK;
|
||||
unsigned had;
|
||||
@ -223,8 +216,7 @@ local int gz_decomp(state)
|
||||
looked for to determine whether to copy or decompress. Returns -1 on error,
|
||||
otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the
|
||||
end of the input file has been reached and all data has been processed. */
|
||||
local int gz_fetch(state)
|
||||
gz_statep state;
|
||||
local int gz_fetch(gz_statep state)
|
||||
{
|
||||
z_streamp strm = &(state->strm);
|
||||
|
||||
@ -253,9 +245,7 @@ local int gz_fetch(state)
|
||||
}
|
||||
|
||||
/* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */
|
||||
local int gz_skip(state, len)
|
||||
gz_statep state;
|
||||
z_off64_t len;
|
||||
local int gz_skip(gz_statep state, z_off64_t len)
|
||||
{
|
||||
unsigned n;
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
OptimizeForProcessor="2"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\deps\rzlib""
|
||||
PreprocessorDefinitions="_DEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="0"
|
||||
@ -71,7 +71,7 @@
|
||||
Optimization="3"
|
||||
OmitFramePointers="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\deps\rzlib""
|
||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;HAVE_GRIFFIN;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@ -126,7 +126,7 @@
|
||||
Optimization="3"
|
||||
OmitFramePointers="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\deps\rzlib""
|
||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;FASTCAP;HAVE_GRIFFIN;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@ -187,7 +187,7 @@
|
||||
OmitFramePointers="TRUE"
|
||||
EnableFiberSafeOptimizations="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\deps\rzlib""
|
||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;inline=_inline;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@ -240,7 +240,7 @@
|
||||
Optimization="3"
|
||||
OmitFramePointers="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\deps\rzlib""
|
||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@ -299,7 +299,7 @@
|
||||
OmitFramePointers="TRUE"
|
||||
EnableFiberSafeOptimizations="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\deps\rzlib""
|
||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;inline=_inline;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@ -352,7 +352,7 @@
|
||||
Optimization="3"
|
||||
OmitFramePointers="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\deps\rzlib""
|
||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
|
Loading…
x
Reference in New Issue
Block a user