Bug 431950 - disable scary-but-harmless zlib trace warnings in debug builds. r=bholley
--- a/modules/zlib/src/ChangeLog.moz
+++ b/modules/zlib/src/ChangeLog.moz
@@ -34,8 +34,11 @@ Mozilla.org changes:
(keeping '#include "mozzconf.h"' in zconf.h)
See bugs #299445 and #300349
- 24 July 2005
Added treatment of HAVE_VISIBILITY_PRAGMA in mozzconf.h
- 24 July 2005
Updated zlib.def with new symbols in zlib version 1.2.3
+
+- 13 September 2009
+ Don't enable zlib's debug output when the Mozilla build is in debug mode (bug 431950)
--- a/modules/zlib/src/zutil.h
+++ b/modules/zlib/src/zutil.h
@@ -233,16 +233,21 @@ extern const char * const z_errmsg[10];
# define zmemzero(dest, len) memset(dest, 0, len)
# endif
#else
extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
extern void zmemzero OF((Bytef* dest, uInt len));
#endif
+/* Ignore the Mozilla build env's DEBUG unless ZLIB_DEBUG is also set */
+#ifndef ZLIB_DEBUG
+#undef DEBUG
+#endif
+
/* Diagnostic functions */
#ifdef DEBUG
# include <stdio.h>
extern int z_verbose;
extern void z_error OF((char *m));
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
# define Tracev(x) {if (z_verbose>0) fprintf x ;}