OLD | NEW |
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..902673b |
| 123 --- /dev/null |
| 124 +++ b/third_party/zlib/mozzconf.h |
| 125 @@ -0,0 +1,170 @@ |
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...) Loading... |
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 68 matching lines...) Loading... |
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 + |
180 +/* Mangle Byte types except on Mac. */ | 289 +/* Mangle Byte types except on Mac. */ |
181 +#if !defined(__MACTYPES__) | 290 +#if !defined(__MACTYPES__) |
182 +#define Byte MOZ_Z_Byte | 291 +#define Byte MOZ_Z_Byte |
183 +#define Bytef MOZ_Z_Bytef | 292 +#define Bytef MOZ_Z_Bytef |
184 +#endif | 293 +#endif |
185 + | 294 + |
186 +#endif | 295 +#endif |
187 diff -ru zlib-1.2.5/zconf.h zlib/zconf.h | 296 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 | 297 index 9987a77..1b1d88b 100644 |
189 +++ zlib/zconf.h» 2011-12-14 08:06:37.000000000 +0800 | 298 --- a/third_party/zlib/zconf.h |
| 299 +++ b/third_party/zlib/zconf.h |
190 @@ -8,6 +8,9 @@ | 300 @@ -8,6 +8,9 @@ |
191 #ifndef ZCONF_H | 301 #ifndef ZCONF_H |
192 #define ZCONF_H | 302 #define ZCONF_H |
193 | 303 |
194 +/* This include does prefixing as below, but with an updated set of names */ | 304 +/* This include does prefixing as below, but with an updated set of names */ |
195 +#include "mozzconf.h" | 305 +#include "mozzconf.h" |
196 + | 306 + |
197 /* | 307 /* |
198 * If you *really* need a unique prefix for all types and library functions, | 308 * 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. | 309 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. |
200 @@ -359,7 +359,7 @@ typedef uLong FAR uLongf; | 310 @@ -408,7 +411,7 @@ typedef uLong FAR uLongf; |
201 typedef Byte *voidp; | 311 typedef unsigned long z_crc_t; |
202 #endif | 312 #endif |
203 | 313 |
204 -#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ | 314 -#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ |
205 +#if !defined(_WIN32) | 315 +#if !defined(_WIN32) |
206 # define Z_HAVE_UNISTD_H | 316 # define Z_HAVE_UNISTD_H |
207 #endif | 317 #endif |
208 | 318 |
209 --- zlib-1.2.5/zlib.h» 2010-04-20 12:12:48.000000000 +0800 | 319 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 | 320 index 3e0c767..36c73af 100644 |
211 @@ -1572,11 +1572,29 @@ | 321 --- a/third_party/zlib/zlib.h |
| 322 +++ b/third_party/zlib/zlib.h |
| 323 @@ -1678,8 +1678,14 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backwa
rd compatibility */ |
| 324 # define z_gzgetc(g) \ |
| 325 ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) |
| 326 #else |
| 327 -# define gzgetc(g) \ |
| 328 +# ifdef MOZZCONF_H |
| 329 +# undef gzgetc |
| 330 +# define gzgetc(g) \ |
| 331 + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : MOZ_Z_gzgetc
(g)) |
| 332 +# else |
| 333 +# define gzgetc(g) \ |
| 334 ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) |
| 335 +# endif |
212 #endif | 336 #endif |
213 | 337 |
214 #if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 | 338 /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or |
215 +# ifdef gzopen | 339 @@ -1706,11 +1712,29 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backw
ard compatibility */ |
216 +# undef gzopen | 340 # define z_adler32_combine z_adler32_combine64 |
| 341 # define z_crc32_combine z_crc32_combine64 |
| 342 # else |
| 343 +# ifdef gzopen |
| 344 +# undef gzopen |
| 345 +# endif |
| 346 # define gzopen gzopen64 |
| 347 +# ifdef gzseek |
| 348 +# undef gzseek |
| 349 +# endif |
| 350 # define gzseek gzseek64 |
| 351 +# ifdef gztell |
| 352 +# undef gztell |
| 353 +# endif |
| 354 # define gztell gztell64 |
| 355 +# ifdef gzoffset |
| 356 +# undef gzoffset |
| 357 +# endif |
| 358 # define gzoffset gzoffset64 |
| 359 +# ifdef adler32_combine |
| 360 +# undef adler32_combine |
| 361 +# endif |
| 362 # define adler32_combine adler32_combine64 |
| 363 +# ifdef crc32_combine |
| 364 +# undef crc32_combine |
| 365 +# endif |
| 366 # define crc32_combine crc32_combine64 |
| 367 # endif |
| 368 # ifndef Z_LARGE64 |
| 369 diff --git a/third_party/zlib/zutil.h b/third_party/zlib/zutil.h |
| 370 index 24ab06b..fe9e53c 100644 |
| 371 --- a/third_party/zlib/zutil.h |
| 372 +++ b/third_party/zlib/zutil.h |
| 373 @@ -28,6 +28,21 @@ |
| 374 # include <string.h> |
| 375 # include <stdlib.h> |
| 376 #endif |
| 377 +#ifdef NO_ERRNO_H |
| 378 +# ifdef _WIN32_WCE |
| 379 + /* The Microsoft C Run-Time Library for Windows CE doesn't have |
| 380 + * errno. We define it as a global variable to simplify porting. |
| 381 + * Its value is always 0 and should not be used. We rename it to |
| 382 + * avoid conflict with other libraries that use the same workaround. |
| 383 + */ |
| 384 +# define errno z_errno |
| 385 +# endif |
| 386 + extern int errno; |
| 387 +#else |
| 388 +# ifndef _WIN32_WCE |
| 389 +# include <errno.h> |
217 +# endif | 390 +# endif |
218 # define gzopen gzopen64 | 391 +#endif |
219 +# ifdef gzseek | 392 |
220 +# undef gzseek | 393 #ifdef Z_SOLO |
221 +# endif | 394 typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */ |
222 # define gzseek gzseek64 | 395 @@ -135,6 +150,12 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-z
lib_error */ |
223 +# ifdef gztell | 396 # define OS_CODE 0x0a |
224 +# undef gztell | 397 #endif |
225 +# endif | 398 |
226 # define gztell gztell64 | 399 +#ifdef _MSC_VER |
227 +# ifdef gzoffset | 400 +#define zalign(x) __declspec(align(x)) |
228 +# undef gzoffset | 401 +#else |
229 +# endif | 402 +#define zalign(x) __attribute__((aligned((x)))) |
230 # define gzoffset gzoffset64 | 403 +#endif |
231 +# ifdef adler32_combine | 404 + |
232 +# undef adler32_combine | 405 #ifdef WIN32 |
233 +# endif | 406 # ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ |
234 # define adler32_combine adler32_combine64 | 407 # define OS_CODE 0x0b |
235 +# ifdef crc32_combine | 408 -- |
236 +# undef crc32_combine | 409 2.7.4 |
237 +# endif | 410 |
238 # define crc32_combine crc32_combine64 | |
239 # ifdef _LARGEFILE64_SOURCE | |
240 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); | |
OLD | NEW |