storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) +
(sourceLen >> 11) + 7;
- /* if can't get parameters, return larger bound plus a zlib wrapper */
+ /* if can't get parameters, return larger bound plus a wrapper */
if (deflateStateCheck(strm))
- return (fixedlen > storelen ? fixedlen : storelen) + 6;
+ return (fixedlen > storelen ? fixedlen : storelen) + 18;
/* compute wrapper length */
s = strm->state;
- switch (s->wrap) {
+ switch (s->wrap < 0 ? -s->wrap : s->wrap) {
case 0: /* raw deflate */
wraplen = 0;
break;
break;
#endif
default: /* for compiler happiness */
- wraplen = 6;
+ wraplen = 18;
}
/* if not default parameters, return one of the conservative bounds */
# define ZLIB_INTERNAL
#endif
-#if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS)
-# define _CRT_SECURE_NO_WARNINGS
-#endif
-#if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE)
-# define _CRT_NONSTDC_NO_DEPRECATE
+#if defined(_WIN32)
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# ifndef _CRT_SECURE_NO_WARNINGS
+# define _CRT_SECURE_NO_WARNINGS
+# endif
+# ifndef _CRT_NONSTDC_NO_DEPRECATE
+# define _CRT_NONSTDC_NO_DEPRECATE
+# endif
#endif
#include <stdio.h>
#include "gzguts.h"
-#if defined(UNDER_CE)
-# define LSEEK _wcelseek
-#elif defined(__DJGPP__)
+#if defined(__DJGPP__)
# define LSEEK llseek
-#elif defined(_WIN32) && !defined(__BORLANDC__)
+#elif defined(_WIN32) && !defined(__BORLANDC__) && !defined(UNDER_CE)
# define LSEEK _lseeki64
#elif defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
# define LSEEK lseek64