diff options
author | gavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-10 12:25:36 +0000 |
---|---|---|
committer | gavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-10 12:25:36 +0000 |
commit | 5a4d2679d2e9b672a99aaa4b59cb638a556f2ead (patch) | |
tree | 9b00f3e0c55fa3c59ed8e0050112830da99bc8f8 /third_party | |
parent | 58affee9e6df8c907557631ffdbe12d5ea497e43 (diff) | |
download | chromium_src-5a4d2679d2e9b672a99aaa4b59cb638a556f2ead.zip chromium_src-5a4d2679d2e9b672a99aaa4b59cb638a556f2ead.tar.gz chromium_src-5a4d2679d2e9b672a99aaa4b59cb638a556f2ead.tar.bz2 |
Fix mangling of zlib API on 64 bit platforms.
It seems https://codereview.chromium.org/8954009/ was a bit
overzealous. On 64 bit platforms, zlib.h attempts to use the 64 bit
API for all callers. But, we were not allowing that, making writing
portable code difficult. This CL updates our manglings in zlib.h so
that on a 64 bit platform the API defaults to the 64 bit version, as
intended.
This change is downstream of https://codereview.chromium.org/13564004/
and must land after it.
R=rsleevi@chromium.org,agl@chromium.org, brettw@chromium.org
BUG=None
Review URL: https://chromiumcodereview.appspot.com/13473020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/zlib/README.chromium | 2 | ||||
-rw-r--r-- | third_party/zlib/google.patch | 41 | ||||
-rw-r--r-- | third_party/zlib/zlib.h | 30 |
3 files changed, 49 insertions, 24 deletions
diff --git a/third_party/zlib/README.chromium b/third_party/zlib/README.chromium index 81d20ef..c9e06ba 100644 --- a/third_party/zlib/README.chromium +++ b/third_party/zlib/README.chromium @@ -14,7 +14,7 @@ A few minor changes, all marked with "Google": - Removed use of strerror for WinCE in gzio.c. - Added 'int z_errno' global for WinCE, to which 'errno' is defined in zutil.h. - Added 'mozzconf.h' to mangle the function names. -- Added an #ifdef to prevent zlib.h from mangling its functions. +- Added logic in zlib.h to undef our earlier mangles when defaulting to 64 bit offset versions of API. The 'google.patch' file represents our changes from the original zlib-1.2.5. A more significant change to support mixed-source data compression. See diff --git a/third_party/zlib/google.patch b/third_party/zlib/google.patch index e2bc2a0..9c3450d 100644 --- a/third_party/zlib/google.patch +++ b/third_party/zlib/google.patch @@ -207,25 +207,34 @@ diff -ru zlib-1.2.5/zconf.h zlib/zconf.h #endif --- zlib-1.2.5/zlib.h 2010-04-20 12:12:48.000000000 +0800 -+++ zlib/zlib.h 2011-12-16 16:08:48.000000000 +0800 -@@ -1572,12 +1572,14 @@ ++++ zlib/zlib.h 2013-04-06 16:08:48.000000000 +0800 +@@ -1572,11 +1572,29 @@ #endif #if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 --# define gzopen gzopen64 --# define gzseek gzseek64 --# define gztell gztell64 --# define gzoffset gzoffset64 --# define adler32_combine adler32_combine64 --# define crc32_combine crc32_combine64 -+# if !defined(MOZZCONF_H) -+# define gzopen gzopen64 -+# define gzseek gzseek64 -+# define gztell gztell64 -+# define gzoffset gzoffset64 -+# define adler32_combine adler32_combine64 -+# define crc32_combine crc32_combine64 ++# ifdef gzopen ++# undef gzopen +# endif + # define gzopen gzopen64 ++# ifdef gzseek ++# undef gzseek ++# endif + # define gzseek gzseek64 ++# ifdef gztell ++# undef gztell ++# endif + # define gztell gztell64 ++# ifdef gzoffset ++# undef gzoffset ++# endif + # define gzoffset gzoffset64 ++# ifdef adler32_combine ++# undef adler32_combine ++# endif + # define adler32_combine adler32_combine64 ++# ifdef crc32_combine ++# undef crc32_combine ++# endif + # define crc32_combine crc32_combine64 # ifdef _LARGEFILE64_SOURCE ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); diff --git a/third_party/zlib/zlib.h b/third_party/zlib/zlib.h index da7e971..e88e5a5 100644 --- a/third_party/zlib/zlib.h +++ b/third_party/zlib/zlib.h @@ -1577,14 +1577,30 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, #endif #if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 -# if !defined(MOZZCONF_H) -# define gzopen gzopen64 -# define gzseek gzseek64 -# define gztell gztell64 -# define gzoffset gzoffset64 -# define adler32_combine adler32_combine64 -# define crc32_combine crc32_combine64 +# ifdef gzopen +# undef gzopen # endif +# define gzopen gzopen64 +# ifdef gzseek +# undef gzseek +# endif +# define gzseek gzseek64 +# ifdef gztell +# undef gztell +# endif +# define gztell gztell64 +# ifdef gzoffset +# undef gzoffset +# endif +# define gzoffset gzoffset64 +# ifdef adler32_combine +# undef adler32_combine +# endif +# define adler32_combine adler32_combine64 +# ifdef crc32_combine +# undef crc32_combine +# endif +# define crc32_combine crc32_combine64 # ifdef _LARGEFILE64_SOURCE ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); |