diff options
author | jmadill <jmadill@chromium.org> | 2016-06-20 06:58:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-20 14:01:19 +0000 |
commit | bf2aebeacfc84bf69ff964edbf212ec3aed6430c (patch) | |
tree | dfa65fc6e4ed637adcd0a4e9a13d353eef01f543 /gzguts.h | |
parent | 90f7dad71a47e992425d7deda7970643990288f3 (diff) | |
download | zlib-bf2aebeacfc84bf69ff964edbf212ec3aed6430c.tar.gz |
Revert of Update Zlib to version 1.2.8 (patchset #10 id:220001 of https://codereview.chromium.org/1955383002/ )
Reason for revert:
Broke the Windows Debug GPU FYI builder:
https://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Win%20Builder%20%28dbg%29/builds/41421
fx_zlib.gzlib.obj : error LNK2005: _gzopen_w already defined in zlib.gzlib.obj
initial\chrome.dll : fatal error LNK1169: one or more multiply defined symbols found
Possibly because they use shared components with a GYP build.
Original issue's description:
> Update Zlib to version 1.2.8
>
> merge the latest open source zlib into chromium external projects
>
> Version 1.2.8 fixes a very rare bug in decompression. All users are encouraged to upgrade immediately. Version 1.2.8 also has these improvements:
> - Add new inflateGetDictionary() function
> - Fix bug where gzopen() immediately followed by gzclose() would write an empty file instead of an empty gzip stream.
> - Fix bug in gzclose() when gzwrite() runs out of memory
> Version 1.2.7 has many portability improvements over 1.2.6, and has these enhancements:
> - Fix bug in gzclose_w() when gzwrite() fails to allocate memory
> - Add "x" (O_EXCL) and "e" (O_CLOEXEC) modes support to gzopen()
> - Add gzopen_w() in Windows for wide character path names
> - Fix type mismatch between get_crc_table() and crc_table
> Version 1.2.6 has many changes over 1.2.5, including these improvements:
> - gzread() can now read a file that is being written concurrently
> - gzgetc() is now a macro for increased speed
> - Added a 'T' option to gzopen() for transparent writing (no compression)
> - Added deflatePending() to return the amount of pending output
> - Allow deflateSetDictionary() and inflateSetDictionary() at any time in raw mode
> - deflatePrime() can now insert bits in the middle of the stream
> - ./configure now creates a configure.log file with all of the results
> - Added a ./configure --solo option to compile zlib with no dependency on any libraries
> - Fixed a problem with large file support macros
> - Fixed a bug in contrib/puff
> - Many portability improvements
>
> BUG=610615
> R=agl@chromium.org
> R=gavinp@chromium.org
>
> Committed: https://crrev.com/a50849ae9ba1b2fad47905db521463b3bf085883
> Cr-Commit-Position: refs/heads/master@{#400647}
TBR=agl@chromium.org,gavinp@chromium.org,khasim.mohammed@linaro.org,jiadong.zhu@linaro.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=610615
Review-Url: https://codereview.chromium.org/2079313002
Cr-Original-Commit-Position: refs/heads/master@{#400670}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 43770253ccc0425c4edde966e56b3e68955cc4d3
Diffstat (limited to 'gzguts.h')
-rw-r--r-- | gzguts.h | 103 |
1 files changed, 13 insertions, 90 deletions
@@ -1,5 +1,5 @@ /* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler + * Copyright (C) 2004, 2005, 2010 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -12,7 +12,7 @@ # endif #endif -#ifdef HAVE_HIDDEN +#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ) # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) #else # define ZLIB_INTERNAL @@ -27,80 +27,13 @@ #endif #include <fcntl.h> -#ifdef _WIN32 -# include <stddef.h> -#endif - -#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) -# include <io.h> -#endif - -#ifdef WINAPI_FAMILY -# define open _open -# define read _read -# define write _write -# define close _close -#endif - #ifdef NO_DEFLATE /* for compatibility with old definition */ # define NO_GZCOMPRESS #endif -#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif - -#if defined(__CYGWIN__) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif - -#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif - -#ifndef HAVE_VSNPRINTF -# ifdef MSDOS -/* vsnprintf may exist on some MS-DOS compilers (DJGPP?), - but for now we just assume it doesn't. */ -# define NO_vsnprintf -# endif -# ifdef __TURBOC__ -# define NO_vsnprintf -# endif -# ifdef WIN32 -/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ -# if !defined(vsnprintf) && !defined(NO_vsnprintf) -# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 ) -# define vsnprintf _vsnprintf -# endif -# endif -# endif -# ifdef __SASC -# define NO_vsnprintf -# endif -# ifdef VMS -# define NO_vsnprintf -# endif -# ifdef __OS400__ -# define NO_vsnprintf -# endif -# ifdef __MVS__ -# define NO_vsnprintf -# endif -#endif - -/* unlike snprintf (which is required in C99, yet still not supported by - Microsoft more than a decade later!), _snprintf does not guarantee null - termination of the result -- however this is only used in gzlib.c where - the result is assured to fit in the space provided */ #ifdef _MSC_VER -# define snprintf _snprintf +# include <io.h> +# define vsnprintf _vsnprintf #endif #ifndef local @@ -119,7 +52,7 @@ # include <windows.h> # define zstrerror() gz_strwinerror((DWORD)GetLastError()) #else -# ifndef NO_STRERROR +# ifdef STDC # include <errno.h> # define zstrerror() strerror(errno) # else @@ -135,15 +68,7 @@ ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); #endif -/* default memLevel */ -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif - -/* default i/o buffer size -- double this for output when reading (this and - twice this must be able to fit in an unsigned type) */ +/* default i/o buffer size -- double this for output when reading */ #define GZBUFSIZE 8192 /* gzip modes, also provide a little integrity check on the passed structure */ @@ -159,25 +84,23 @@ /* internal gzip file state data structure */ typedef struct { - /* exposed contents for gzgetc() macro */ - struct gzFile_s x; /* "x" for exposed */ - /* x.have: number of bytes available at x.next */ - /* x.next: next output data to deliver or write */ - /* x.pos: current position in uncompressed data */ /* used for both reading and writing */ int mode; /* see gzip modes above */ int fd; /* file descriptor */ char *path; /* path or fd for error messages */ + z_off64_t pos; /* current position in uncompressed data */ unsigned size; /* buffer size, zero if not allocated yet */ unsigned want; /* requested buffer size, default is GZBUFSIZE */ unsigned char *in; /* input buffer */ unsigned char *out; /* output buffer (double-sized when reading) */ - int direct; /* 0 if processing gzip, 1 if transparent */ + unsigned char *next; /* next output data to deliver or write */ /* just for reading */ - int how; /* 0: get header, 1: copy, 2: decompress */ - z_off64_t start; /* where the gzip data started, for rewinding */ + unsigned have; /* amount of output data unused at next */ int eof; /* true if end of input file reached */ - int past; /* true if read requested past end */ + z_off64_t start; /* where the gzip data started, for rewinding */ + z_off64_t raw; /* where the raw data started, for seeking */ + int how; /* 0: get header, 1: copy, 2: decompress */ + int direct; /* true if last read direct, false if gzip */ /* just for writing */ int level; /* compression level */ int strategy; /* compression strategy */ |