Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: third_party/zlib/google.patch

Issue 2084863002: Update Zlib to version 1.2.8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/zlib/deflate.c ('k') | third_party/zlib/gzguts.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 diff -ru zlib-1.2.5/gzlib.c zlib/gzlib.c 1 diff --git a/third_party/zlib/contrib/minizip/ioapi.h b/third_party/zlib/contrib /minizip/ioapi.h
2 --- zlib-1.2.5/gzlib.c 2 index 8dcbdb0..c1b7a54 100644
3 +++ zlib/gzlib.c 3 --- a/third_party/zlib/contrib/minizip/ioapi.h
4 @@ -5,7 +5,9 @@ 4 +++ b/third_party/zlib/contrib/minizip/ioapi.h
5 @@ -43,7 +43,7 @@
5 6
6 #include "gzguts.h" 7 #include <stdio.h>
8 #include <stdlib.h>
9 -#include "zlib.h"
10 +#include "third_party/zlib/zlib.h"
7 11
8 -#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 12 #if defined(USE_FILE32API)
9 +#if defined(_WIN32) 13 #define fopen64 fopen
10 +# define LSEEK (z_off64_t)_lseeki64 14 diff --git a/third_party/zlib/contrib/minizip/mztools.c b/third_party/zlib/contr ib/minizip/mztools.c
11 +#elif defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 15 index 96891c2..8bf9cca 100644
12 # define LSEEK lseek64 16 --- a/third_party/zlib/contrib/minizip/mztools.c
17 +++ b/third_party/zlib/contrib/minizip/mztools.c
18 @@ -8,7 +8,7 @@
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
22 -#include "zlib.h"
23 +#include "third_party/zlib/zlib.h"
24 #include "unzip.h"
25
26 #define READ_8(adr) ((unsigned char)*(adr))
27 diff --git a/third_party/zlib/contrib/minizip/mztools.h b/third_party/zlib/contr ib/minizip/mztools.h
28 index a49a426..f295ffe 100644
29 --- a/third_party/zlib/contrib/minizip/mztools.h
30 +++ b/third_party/zlib/contrib/minizip/mztools.h
31 @@ -12,7 +12,7 @@ extern "C" {
32 #endif
33
34 #ifndef _ZLIB_H
35 -#include "zlib.h"
36 +#include "third_party/zlib/zlib.h"
37 #endif
38
39 #include "unzip.h"
40 diff --git a/third_party/zlib/contrib/minizip/unzip.c b/third_party/zlib/contrib /minizip/unzip.c
41 index 9093504..2d5f0b1 100644
42 --- a/third_party/zlib/contrib/minizip/unzip.c
43 +++ b/third_party/zlib/contrib/minizip/unzip.c
44 @@ -72,7 +72,7 @@
45 #define NOUNCRYPT
46 #endif
47
48 -#include "zlib.h"
49 +#include "third_party/zlib/zlib.h"
50 #include "unzip.h"
51
52 #ifdef STDC
53 @@ -1705,11 +1705,6 @@ extern int ZEXPORT unzReadCurrentFile (unzFile file, voi dp buf, unsigned len)
54
55 pfile_in_zip_read_info->stream.avail_out = (uInt)len;
56
57 - if ((len>pfile_in_zip_read_info->rest_read_uncompressed) &&
58 - (!(pfile_in_zip_read_info->raw)))
59 - pfile_in_zip_read_info->stream.avail_out =
60 - (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
61 -
62 if ((len>pfile_in_zip_read_info->rest_read_compressed+
63 pfile_in_zip_read_info->stream.avail_in) &&
64 (pfile_in_zip_read_info->raw))
65 diff --git a/third_party/zlib/contrib/minizip/unzip.h b/third_party/zlib/contrib /minizip/unzip.h
66 index 2104e39..3c01435 100644
67 --- a/third_party/zlib/contrib/minizip/unzip.h
68 +++ b/third_party/zlib/contrib/minizip/unzip.h
69 @@ -48,7 +48,7 @@ extern "C" {
70 #endif
71
72 #ifndef _ZLIB_H
73 -#include "zlib.h"
74 +#include "third_party/zlib/zlib.h"
75 #endif
76
77 #ifndef _ZLIBIOAPI_H
78 diff --git a/third_party/zlib/contrib/minizip/zip.c b/third_party/zlib/contrib/m inizip/zip.c
79 index ea54853..aaf6961 100644
80 --- a/third_party/zlib/contrib/minizip/zip.c
81 +++ b/third_party/zlib/contrib/minizip/zip.c
82 @@ -26,7 +26,7 @@
83 #include <stdlib.h>
84 #include <string.h>
85 #include <time.h>
86 -#include "zlib.h"
87 +#include "third_party/zlib/zlib.h"
88 #include "zip.h"
89
90 #ifdef STDC
91 diff --git a/third_party/zlib/contrib/minizip/zip.h b/third_party/zlib/contrib/m inizip/zip.h
92 index 8aaebb6..8c06c0a 100644
93 --- a/third_party/zlib/contrib/minizip/zip.h
94 +++ b/third_party/zlib/contrib/minizip/zip.h
95 @@ -47,7 +47,7 @@ extern "C" {
96 //#define HAVE_BZIP2
97
98 #ifndef _ZLIB_H
99 -#include "zlib.h"
100 +#include "third_party/zlib/zlib.h"
101 #endif
102
103 #ifndef _ZLIBIOAPI_H
104 diff --git a/third_party/zlib/gzread.c b/third_party/zlib/gzread.c
105 index bf4538e..4e11246 100644
106 --- a/third_party/zlib/gzread.c
107 +++ b/third_party/zlib/gzread.c
108 @@ -383,7 +383,11 @@ int ZEXPORT gzread(file, buf, len)
109 # undef z_gzgetc
13 #else 110 #else
14 # define LSEEK lseek 111 # undef gzgetc
15 diff -ru zlib-1.2.5/mozzconf.h zlib/mozzconf.h 112 +# ifdef MOZZCONF_H
16 --- zlib-1.2.5/mozzconf.h» 2011-12-15 18:10:49.000000000 +0800 113 +# define gzgetc MOZ_Z_gzgetc
17 +++ zlib/mozzconf.h» 2011-12-16 16:08:00.000000000 +0800 114 +# endif
18 @@ -0,0 +1,168 @@ 115 #endif
116 +
117 int ZEXPORT gzgetc(file)
118 gzFile file;
119 {
120 diff --git a/third_party/zlib/mozzconf.h b/third_party/zlib/mozzconf.h
121 new file mode 100644
122 index 0000000..80994c9
123 --- /dev/null
124 +++ b/third_party/zlib/mozzconf.h
125 @@ -0,0 +1,177 @@
19 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 126 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
20 +/* ***** BEGIN LICENSE BLOCK ***** 127 +/* ***** BEGIN LICENSE BLOCK *****
21 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 128 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
22 + * 129 + *
23 + * The contents of this file are subject to the Mozilla Public License Version 130 + * The contents of this file are subject to the Mozilla Public License Version
24 + * 1.1 (the "License"); you may not use this file except in compliance with 131 + * 1.1 (the "License"); you may not use this file except in compliance with
25 + * the License. You may obtain a copy of the License at 132 + * the License. You may obtain a copy of the License at
26 + * http://www.mozilla.org/MPL/ 133 + * http://www.mozilla.org/MPL/
27 + * 134 + *
28 + * Software distributed under the License is distributed on an "AS IS" basis, 135 + * Software distributed under the License is distributed on an "AS IS" basis,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 +#define compress MOZ_Z_compress 192 +#define compress MOZ_Z_compress
86 +#define compress2 MOZ_Z_compress2 193 +#define compress2 MOZ_Z_compress2
87 +#define compressBound MOZ_Z_compressBound 194 +#define compressBound MOZ_Z_compressBound
88 +#define uncompress MOZ_Z_uncompress 195 +#define uncompress MOZ_Z_uncompress
89 +#define gzopen MOZ_Z_gzopen 196 +#define gzopen MOZ_Z_gzopen
90 +#define gzdopen MOZ_Z_gzdopen 197 +#define gzdopen MOZ_Z_gzdopen
91 +#define gzsetparams MOZ_Z_gzsetparams 198 +#define gzsetparams MOZ_Z_gzsetparams
92 +#define gzread MOZ_Z_gzread 199 +#define gzread MOZ_Z_gzread
93 +#define gzwrite MOZ_Z_gzwrite 200 +#define gzwrite MOZ_Z_gzwrite
94 +#define gzprintf MOZ_Z_gzprintf 201 +#define gzprintf MOZ_Z_gzprintf
202 +#define gzvprintf MOZ_Z_gzvprintf
95 +#define gzputs MOZ_Z_gzputs 203 +#define gzputs MOZ_Z_gzputs
96 +#define gzgets MOZ_Z_gzgets 204 +#define gzgets MOZ_Z_gzgets
97 +#define gzputc MOZ_Z_gzputc 205 +#define gzputc MOZ_Z_gzputc
98 +#define gzgetc MOZ_Z_gzgetc 206 +#define gzgetc MOZ_Z_gzgetc
207 +#define gzgetc_ MOZ_Z_gzgetc_
99 +#define gzungetc MOZ_Z_gzungetc 208 +#define gzungetc MOZ_Z_gzungetc
100 +#define gzflush MOZ_Z_gzflush 209 +#define gzflush MOZ_Z_gzflush
101 +#define gzseek MOZ_Z_gzseek 210 +#define gzseek MOZ_Z_gzseek
102 +#define gzrewind MOZ_Z_gzrewind 211 +#define gzrewind MOZ_Z_gzrewind
103 +#define gztell MOZ_Z_gztell 212 +#define gztell MOZ_Z_gztell
104 +#define gzeof MOZ_Z_gzeof 213 +#define gzeof MOZ_Z_gzeof
105 +#define gzclose MOZ_Z_gzclose 214 +#define gzclose MOZ_Z_gzclose
106 +#define gzerror MOZ_Z_gzerror 215 +#define gzerror MOZ_Z_gzerror
107 +#define gzclearerr MOZ_Z_gzclearerr 216 +#define gzclearerr MOZ_Z_gzclearerr
108 +#define adler32 MOZ_Z_adler32 217 +#define adler32 MOZ_Z_adler32
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 +#define uInt MOZ_Z_uInt 279 +#define uInt MOZ_Z_uInt
171 +#define uIntf MOZ_Z_uIntf 280 +#define uIntf MOZ_Z_uIntf
172 +#define uLong MOZ_Z_uLong 281 +#define uLong MOZ_Z_uLong
173 +#define uLongf MOZ_Z_uLongf 282 +#define uLongf MOZ_Z_uLongf
174 +#define voidp MOZ_Z_voidp 283 +#define voidp MOZ_Z_voidp
175 +#define voidpc MOZ_Z_voidpc 284 +#define voidpc MOZ_Z_voidpc
176 +#define voidpf MOZ_Z_voidpf 285 +#define voidpf MOZ_Z_voidpf
177 +#define gz_header_s MOZ_Z_gz_header_s 286 +#define gz_header_s MOZ_Z_gz_header_s
178 +#define internal_state MOZ_Z_internal_state 287 +#define internal_state MOZ_Z_internal_state
179 + 288 +
289 +/* New as of zlib 1.2.8 */
290 +#define deflateResetKeep MOZ_Z_deflateResetKeep
291 +#define deflatePending MOZ_Z_deflatePending
292 +#define inflateGetDictionary MOZ_Z_inflateGetDictionary
293 +#define inflateResetKeep MOZ_Z_inflateResetKeep
294 +#define gzopen_w MOZ_Z_gzopen_w
295 +
180 +/* Mangle Byte types except on Mac. */ 296 +/* Mangle Byte types except on Mac. */
181 +#if !defined(__MACTYPES__) 297 +#if !defined(__MACTYPES__)
182 +#define Byte MOZ_Z_Byte 298 +#define Byte MOZ_Z_Byte
183 +#define Bytef MOZ_Z_Bytef 299 +#define Bytef MOZ_Z_Bytef
184 +#endif 300 +#endif
185 + 301 +
186 +#endif 302 +#endif
187 diff -ru zlib-1.2.5/zconf.h zlib/zconf.h 303 diff --git a/third_party/zlib/zconf.h b/third_party/zlib/zconf.h
188 --- zlib-1.2.5/zconf.h» 2010-04-19 01:58:06.000000000 +0800 304 index 9987a77..1b1d88b 100644
189 +++ zlib/zconf.h» 2011-12-14 08:06:37.000000000 +0800 305 --- a/third_party/zlib/zconf.h
306 +++ b/third_party/zlib/zconf.h
190 @@ -8,6 +8,9 @@ 307 @@ -8,6 +8,9 @@
191 #ifndef ZCONF_H 308 #ifndef ZCONF_H
192 #define ZCONF_H 309 #define ZCONF_H
193 310
194 +/* This include does prefixing as below, but with an updated set of names */ 311 +/* This include does prefixing as below, but with an updated set of names */
195 +#include "mozzconf.h" 312 +#include "mozzconf.h"
196 + 313 +
197 /* 314 /*
198 * If you *really* need a unique prefix for all types and library functions, 315 * If you *really* need a unique prefix for all types and library functions,
199 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. 316 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
200 @@ -359,7 +359,7 @@ typedef uLong FAR uLongf; 317 @@ -408,7 +411,7 @@ typedef uLong FAR uLongf;
201 typedef Byte *voidp; 318 typedef unsigned long z_crc_t;
202 #endif 319 #endif
203 320
204 -#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ 321 -#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
205 +#if !defined(_WIN32) 322 +#if !defined(_WIN32)
206 # define Z_HAVE_UNISTD_H 323 # define Z_HAVE_UNISTD_H
207 #endif 324 #endif
208 325
209 --- zlib-1.2.5/zlib.h» 2010-04-20 12:12:48.000000000 +0800 326 diff --git a/third_party/zlib/zlib.h b/third_party/zlib/zlib.h
210 +++ zlib/zlib.h»2013-04-06 16:08:48.000000000 +0800 327 index 3e0c767..36c73af 100644
211 @@ -1572,11 +1572,29 @@ 328 --- a/third_party/zlib/zlib.h
329 +++ b/third_party/zlib/zlib.h
330 @@ -1678,8 +1678,14 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backwa rd compatibility */
331 # define z_gzgetc(g) \
332 ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
333 #else
334 -# define gzgetc(g) \
335 +# ifdef MOZZCONF_H
336 +# undef gzgetc
337 +# define gzgetc(g) \
338 + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : MOZ_Z_gzgetc (g))
339 +# else
340 +# define gzgetc(g) \
341 ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
342 +# endif
212 #endif 343 #endif
213 344
214 #if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 345 /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
215 +# ifdef gzopen 346 @@ -1706,11 +1712,29 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backw ard compatibility */
216 +# undef gzopen 347 # define z_adler32_combine z_adler32_combine64
348 # define z_crc32_combine z_crc32_combine64
349 # else
350 +# ifdef gzopen
351 +# undef gzopen
352 +# endif
353 # define gzopen gzopen64
354 +# ifdef gzseek
355 +# undef gzseek
356 +# endif
357 # define gzseek gzseek64
358 +# ifdef gztell
359 +# undef gztell
360 +# endif
361 # define gztell gztell64
362 +# ifdef gzoffset
363 +# undef gzoffset
364 +# endif
365 # define gzoffset gzoffset64
366 +# ifdef adler32_combine
367 +# undef adler32_combine
368 +# endif
369 # define adler32_combine adler32_combine64
370 +# ifdef crc32_combine
371 +# undef crc32_combine
372 +# endif
373 # define crc32_combine crc32_combine64
374 # endif
375 # ifndef Z_LARGE64
376 diff --git a/third_party/zlib/zutil.h b/third_party/zlib/zutil.h
377 index 24ab06b..fe9e53c 100644
378 --- a/third_party/zlib/zutil.h
379 +++ b/third_party/zlib/zutil.h
380 @@ -28,6 +28,21 @@
381 # include <string.h>
382 # include <stdlib.h>
383 #endif
384 +#ifdef NO_ERRNO_H
385 +# ifdef _WIN32_WCE
386 + /* The Microsoft C Run-Time Library for Windows CE doesn't have
387 + * errno. We define it as a global variable to simplify porting.
388 + * Its value is always 0 and should not be used. We rename it to
389 + * avoid conflict with other libraries that use the same workaround.
390 + */
391 +# define errno z_errno
392 +# endif
393 + extern int errno;
394 +#else
395 +# ifndef _WIN32_WCE
396 +# include <errno.h>
217 +# endif 397 +# endif
218 # define gzopen gzopen64 398 +#endif
219 +# ifdef gzseek 399
220 +# undef gzseek 400 #ifdef Z_SOLO
221 +# endif 401 typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */
222 # define gzseek gzseek64 402 @@ -135,6 +150,12 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-z lib_error */
223 +# ifdef gztell 403 # define OS_CODE 0x0a
224 +# undef gztell 404 #endif
225 +# endif 405
226 # define gztell gztell64 406 +#ifdef _MSC_VER
227 +# ifdef gzoffset 407 +#define zalign(x) __declspec(align(x))
228 +# undef gzoffset 408 +#else
229 +# endif 409 +#define zalign(x) __attribute__((aligned((x))))
230 # define gzoffset gzoffset64 410 +#endif
231 +# ifdef adler32_combine 411 +
232 +# undef adler32_combine 412 #ifdef WIN32
233 +# endif 413 # ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */
234 # define adler32_combine adler32_combine64 414 # define OS_CODE 0x0b
235 +# ifdef crc32_combine 415 --
236 +# undef crc32_combine 416 2.7.4
237 +# endif 417
238 # define crc32_combine crc32_combine64
239 # ifdef _LARGEFILE64_SOURCE
240 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
OLDNEW
« no previous file with comments | « third_party/zlib/deflate.c ('k') | third_party/zlib/gzguts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698